9
votes

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?

2
Is this a programming question? - Gabe
I think so...changing the default baud rate is either a kernel mod or a change to the device-tree source. I just don't know where it needs to be done. - dan6470
It is the "application" that uses your ttys that is going to set the baud rate of the corresponding serial port. What do you want to use the ttyS[1-3] for ? What it the program using them ? - Longfield
The console of the system is on ttyS0, however I also need the linux startup scripts to cat messages to ttyS1. So there is no application that will be setting the baud rate. - dan6470
And how is it done, that the startup scripts cat messages to ttyS1 ? Then it would the responsibility of these script to set the baud rate of ttyS1 before sending any message to it. Have a look at the stty command. - Longfield

2 Answers

1
votes

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               
0
votes

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.