2016-11-10 144 views
0

我正在將Linux移植到使用ARM Primecell pl011串行IP內核的定製板上。linux pl011串行驅動程序:打開/ dev/console後不輸出

  • Linux版本是4.7.0-rc1 +。
  • 我沒有使用DMA引擎。
  • 我使用
  • 我指定
  • 啓動日誌打開/ dev之前以及輸出引導參數「控制檯= ttyAMA0」 /控制檯
  • 打開/ dev後輸出將停止/控制檯devtmpfs

INIT/main.c中:kernel_init_freeable()

[...] 
printk("open /dev/console\n");  // <- this will be outputted 
/* Open the /dev/console on the rootfs, this should never fail */ 
if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) 
    pr_err("Warning: unable to open an initial console.\n"); 
printk("opened /dev/console\n");  // <- this will not be outputted 
[...] 

任何提示被理解...

回答

0

我找到了罪魁禍首! DTS中的時鐘頻率設置不正確。 我猜想使用錯誤時鐘的驅動程序和輸出可能偶然出現(我沒有在bootargs中指定波特率,這只是「console = ttyAMA0」) 當我將DTS中的時鐘頻率更改爲正確的一個時。所有的事情都完美了!