2015年2月16日 星期一

MSM8909 2pin-UART 沒LOG輸出

剛下載的  MSM8909  , compile 後, 卻發現...
開機的UART  Console LOG 只有幾秒(一但 boot  console, early console被turn off  後就沒LOG了)

我們公司的UART 只接了2隻pin 腳,  即 :
GPIO4--> UART  TX
GPIO5-->  UART  RX
就醬~~

結果就是...  沒LOG 了....
當然依QC給的文件  80-NU767-1 去改...
不過...  應該沒啥用...   呵~~

先給解法,  喜歡找為什麼的人,  就再往後看怎麼debug吧~~

解法:
kernel/arch/arm/configs/msm8909-xxx_defconfig:
查看看起下的是否都有開?
CONFIG_SERIAL_MSM
CONFIG_SERIAL_MSM_CONSOLE
CONFIG_SERIAL_MSM_HS
CONFIG_SERIAL_MSM_HSL
CONFIG_SERIAL_MSM_HSL_CONSOLE
CONFIG_GPIOLIB
CONFIG_GPIO_GENERIC
CONFIG_GPIO_MSM_V3

主要是這部份(應該有多開了幾項,  各位大大可以查一下那幾項可省)
CONFIG_PINCTRL
CONFIG_PINMUX
CONFIG_PINCONF
CONFIG_GENERIC_PINCONF
CONFIG_PINCTRL_SINGLE
CONFIG_USE_PINCTRL_IRQ
CONFIG_PINCTRL_MSM_TLMM
如此就OK了~~
 簡言之就是...   dts中明明就是用pinctrl 去調控pin的設定,
可是卻沒有driver去handle, 因此當然就不會動囉~~


DEBUG技巧:
1.  QC的Kernel是採用3.1x,  因此,  所有的devices 的註冊是源自device  tree
也就是板子上有那些週邊全靠device  tree來決定,
所以......   第一步當然是先確認   UART的node是否有被正常讀到...
我在查的時後,  利用修改:
kernel/driver/base/core.c中的 device_register,  填加一行
pr_err("========== %s:  %s  \n",  __func__,  dev->of_node->name);
再利用開機時 boot   UART  console還可印訊息掃出kernel找到的  device  nodes

2.   修改  kernel/driver/base/bus.c   印出找到那些bus裝置
在 bus_register 印出 bus->name

3.  修改  platform_driver_probe  印出那些driver正常被 probe(有device tree  node且driver有配到)
印   drv->driver.name

4.  接下去當然是改
driver/tty/serial/msm_serialxxxx.c了

查的時後可以看到 有node, 但無法probe...
所以應該是driver的對映配對有問題...
這下問題就簡單很多啦~~

a. 找找config設定
b.  是否ID 配對有問題
c.  是否 driver   在  probe時有錯誤


1 則留言:

  1. Did you hear there is a 12 word sentence you can tell your man... that will induce deep feelings of love and instinctual attractiveness for you buried inside his heart?

    Because deep inside these 12 words is a "secret signal" that fuels a man's instinct to love, admire and look after you with his entire heart...

    =====> 12 Words Will Trigger A Man's Love Impulse

    This instinct is so built-in to a man's brain that it will drive him to work better than ever before to make your relationship as strong as it can be.

    In fact, fueling this influential instinct is absolutely binding to having the best possible relationship with your man that once you send your man one of these "Secret Signals"...

    ...You will instantly find him expose his heart and soul for you in a way he haven't expressed before and he will see you as the only woman in the galaxy who has ever truly understood him.

    回覆刪除