linux pl011串口驱动: do not output after open/dev/console

标签 linux serial-port arm kernel

我正在将 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
[...]

感谢任何提示...

最佳答案

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

关于linux pl011串口驱动: do not output after open/dev/console,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40518958/

相关文章:

linux - 更改后编译 Linux 内核

android - 通过 Android 与串行 USB 设备通信

java - 片段着色器行为异常(测试网格)

android - Android内核中PC和LR功能相同

python - 使用 Python 串行读取 MATLAB 单曲

c++ - 在 C++ 中使用乘法累加指令内联汇编

python - 使用 pip 升级最初通过 apt 安装的包

linux - 设置 Fix Client 以记录报价数据

Linux命令发送数据到远程tcp客户端

python - 如何使用 pyserial 和 picocom 打印仅十六进制缓冲区?