最近一直在搞open BMC的串口问题,费了很长时间,主要原因还是不熟。
问题描述:
我们使用浪潮的BMC,对应板子的串口可以正常输出BIOS的启动过程,但是使用我这个分支的BMC,串口并不能输出BIOS对应的启动信息。
分析过程:
从问题可知,问题出在BMC侧,BIOS已经完成了重定向的设置。
BMC上的串口组件是UART,对应的串口控制器描述如下:
39 UART Controller (16550)39.1 OverviewAST2500 integrates 5 sets of UART (Universal Asynchronous Receiver/Transmitter) providing serial communication capabilities with other external devices, like another computer using a serial cable based on RS232protocol. This core is designed to be compatible with the industry standard — 16550 UART. The two sets ofUART are equipped with a 16x8 FIFO that can be programmed to be enabled or disabled. The supported baudrates are also programmable.Each unit of UART totally implements 12 sets of 32-bit registers, which are listed below, to program the varioussupported functions including character length selection, baud rate selection, interrupt generation, and paritygeneration/checking. Each register has its own specifific offset value, ranging from 0x00 to 0x14h, to derive itsphysical address location.Base Address of UART1 = 0x1E78 3000Base Address of UART2 = 0x1E78 D000Base Address of UART3 = 0x1E78 E000Base Address of UART4 = 0x1E78 F000Base Address of UART5 = 0x1E78 4000Register Address of UART = (Base Address of UART) + OffsetUART RBR : Receiving Buffer Register (DLAB = 0)UART THR : Transmit Holding Register (DLAB = 0)UART IER : Interrupt Enable Register (DLAB = 0)UART IIR : Interrupt Identity RegisterUART FCR : FIFO Control RegisterUART LCR : Line Control RegisterUART MCR : Modem Control RegisterUART LSR : Line Status RegisterUART MSR : Modem Status RegisterUART SCR : Scratch RegisterUART DLL : Divisor Latch Low Register : (DLAB = 1)UART DLH : Divisor Latch High Register : (DLAB = 1)39.2 Features• Directly connected to APB busASPEED ConfifidentialAll rights reserved.631May 12, 2017ASPEEDConfifidential ASPEED AST2500/AST2520 A2 Datasheet – V1.6• Support two UART with full flflow control pins (one is with dedicated flflow control pins, the other is sharedwith GPIO pins)• Separate transmit & receive FIFO buffer (16x8) to reduce CPU interrupts• Support up to 115.2K baud-rate• Programmable baud rate generator• Standard asynchronous communication bits — Stat/Stop/Parity• Independent masking of transmit FIFO, receive FIFO, receiving timeout and error condition Interrupts• False start-bit detection• Line break generation and detection• Fully programmable serial interface characteristics:– 5/6/7/8 data length– Even, odd and none parity generation and detection– 1/2 stop-bit generation• Extended diagnostic Loopback Mode allows testing more Modem Control and Auto Flow Control features
ast2500支持5组串口,12个寄存器。所以我需要先知道板子上的定向输出BIOS的串口是哪一个口,经过查询可知为串口1。
拿到串口后,查询设备树,发现设备树确实没有添加uart1,导致串口不能用。我首先想到的的是enable uart 1,即在设备树添加:
&uart1 {
status = "okay";}
添加完以后,串口依旧不能输出对应的BIOS信息,但是通过跳线(先用浪潮的BMC启动,再跳线切到我的bmc),发现串口可以输出了。
到这里,说明,我的串口应该还有一些初始化配置未能加载和操作,导致输出不了启动信息。到这里只能求助到浪潮的工作人员,让他们发送串口1的设备树配置过来,看看结果。
最后,终于拿到了串口1的设备树信息:
&uart1 {
/* Rear RS-232 connector */
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_txd1_default
&pinctrl_rxd1_default
&pinctrl_nrts1_default
&pinctrl_ndtr1_default
&pinctrl_ndsr1_default
&pinctrl_ncts1_default
&pinctrl_ndcd1_default
&pinctrl_nri1_default>;
};
添加到设备树,通信正常。从配置看,是配置了pin脚,pinctrl的具体配置我也没看懂,有看懂的朋友留言交流。
最后:
点赞是美德,
关注是缘分,
收藏是肯定,
打赏你随意,
你的鼓励是我世界善的一部分,爱你们!