【问题标题】:linux pl011 serial driver: do not output after open /dev/consolelinux pl011串口驱动:打开/dev/console后不输出
【发布时间】:2017-03-23 23:18:14
【问题描述】:

我正在将 linux 移植到使用 ARM Primecell pl011 串行 IP 内核的定制板上。

  • Linux 版本为 4.7.0-rc1+。
  • 我没有使用 DMA 引擎。
  • 我正在使用 devtmpfs
  • 我指定了启动参数“console=ttyAMA0”
  • 在打开/dev/console之前就输出了启动日志
  • 打开 /dev/console 后将停止输出

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
[...]

感谢任何提示...

【问题讨论】:

    标签: linux serial-port arm kernel


    【解决方案1】:

    我找到了罪魁祸首!!! DTS 中的时钟频率设置错误。 我猜驱动程序使用了错误的时钟并且可以偶然看到输出。(我没有在 bootargs 中指定波特率,即只有“console=ttyAMA0”) 当我将 DTS 中的时钟频率更改为正确的频率时。现在一切都完美了!!!

    【讨论】:

      猜你喜欢
      • 2015-06-09
      • 2014-03-27
      • 1970-01-01
      • 2013-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多