默认波特率 - linux/u-boot

发布于 2024-12-16 18:38:23 字数 266 浏览 3 评论 0原文

我正在使用 u-boot 开发嵌入式 Linux 系统。 U-boot 使用 console= bootarg 设置 ttyS0 串口的波特率,但我还想设置 ttyS[1-3] 的默认波特率(设置为 9600 以外的值)。

在此系统中,U-boot 将设备树(dts/dtb)传递给内核,但在那里设置波特率似乎不起作用。

需要注意的是,该系统类似于canyonlands板(ppc460ex)。

无论如何,在u-boot、内核或设备树中是否可以更改串行端口的默认波特率?

I'm working on the development of an embedded linux system using u-boot. U-boot sets the baud rate of the ttyS0 serial port with the console= bootarg, but I would also like to set the default baud rate of ttyS[1-3] (to something other than 9600).

In this system U-boot passes a device-tree (dts/dtb) to the kernel, but setting the baud rate there doesn't seem to be working.

To note, this system is similar to the canyonlands board (ppc460ex).

Is there anyway in u-boot, the kernel, or device-tree to change the default baud rate of the serial ports?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

落日海湾 2024-12-23 18:38:23

有时,以下文件中的值会覆盖 DTS 文件中给出的信息。
检查u-boot源代码中的以下文件

boot/include/configs/[board name].h -- used for specifying environment and CPU peripheral   default value
boot/common/[board name]_cmd_common.h               

Sometimes the values in the below file overrides the information given in the DTS file.
Check the below file in the u-boot source code

boot/include/configs/[board name].h -- used for specifying environment and CPU peripheral   default value
boot/common/[board name]_cmd_common.h               
樱娆 2024-12-23 18:38:23

原文中已经提到,设备设置似乎被内核忽略了。

在此系统中,U-boot 将设备树(dts/dtb)传递给内核,但在那里设置波特率似乎不起作用。

如果您在设备树中硬编码新的波特率,则它可能会在引导过程中被覆盖。设备树在后续引导过程中实际传递到内核之前由 u-boot 更新。查看u-boot源代码中的ft_board_setup()。我自己一直在使用 u-boot 的 PowerPC 44X 分支,并且 fdt 代码更新“时钟频率”,但不更新串行设备的“当前速度”属性。您正在处理的分支可能有不同的代码库。

In the original text, it has been mentioned that the device setting seems to be ignored by the kernel.

In this system U-boot passes a device-tree (dts/dtb) to the kernel, but setting the baud rate there doesn't seem to be working.

If you are hard coding the new baud rate in the device-tree, it is possible that it is overwritten during the boot process. The device-tree gets updated by u-boot before actually being passed to the kernel during the subsequent boot process. Look at ft_board_setup() in u-boot source code. My self has been working with the the PowerPC 44X branch of u-boot and the fdt code updates the "clock-frequency" but not the "current-speed" attribute of the serial devices. The branch you are working on might have a different code base.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文