9

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?

dan6470
  • 309
  • 2
  • 4
  • 9
  • Is this a programming question? – Gabe Nov 16 '11 at 06:01
  • 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 Nov 16 '11 at 06:11
  • 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 Nov 16 '11 at 08:00
  • 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 Nov 16 '11 at 18:54
  • 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 Nov 17 '11 at 07:50
  • Hi dan6470, my colleague successfully changed the serial baudrate by modifying the .dts file. I do not know exactly what he did, but when I asked him about the serial problem (baudrate from u-boot and linux are different), he said I was using the wrong .dtb file. Hope it can give you some clues. – Dien Nguyen Dec 06 '11 at 16:43

2 Answers2

2

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               
New to Rails
  • 2,824
  • 5
  • 27
  • 43
0

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.

sessyargc.jp
  • 573
  • 5
  • 15