How to I change the u-boot serial port on the LS1028ARDB demo board

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to I change the u-boot serial port on the LS1028ARDB demo board

跳至解决方案
2,157 次查看
jrevans
Contributor III

How do I change the default u-boot serial port from UART1 to UART2 on the LS1028ARDB demo board?

I'm building the Yocto image, and can change the linux console port to UART2 by editing CONFIG_EXTRA_ENV_SETTINGS in u-boot-qoriq/include/configs/ls1028ardb.h to use "bootargs=console=ttyS1,115200\0" instead of "bootargs=console=ttyS0,115200\0"
But I cannot figure out how to change the u-boot serial port.

I thought that changing this:
chosen {
   stdout-path = "serial0:115200n8";
};
in fsl-ls1028a-rdb.dts from serial0 to serial1 would make the change, but it didn't.

I see other boards add CONFIG_CONS_INDEX and CONFIG_MXC_UART_BASE to the defconfig file, but that doesn't seem to be appropriate for the LS1028ARDB.

I want both u-boot and the linux kernel to use UART2 as the default console, but so far I can only get Linux to do it.

0 项奖励
回复
1 解答
1,991 次查看
jrevans
Contributor III

Well, I figured out the solution with a co-workers assistance.

First off, my build environment was corrupted and for whatever reason, some of the changes that I made did not get put into my Yocto image. It was odd, as I could change the ls1028ardb.h file and the change took effect, but changing the fsl-ls1028a-rdb.dts file or the ls1028ardb_tfa_defconfig file did not take effect.  The joys of Yocto.  When I looked at the build/tmp/work/blah... directory, my changes to defconfig did not appear in the .config file.  To fix that, I had to abandon my changes and reset devtool.

From the build directory:

devtool reset u-boot-qoriq
rm -rf ../sources/workspace/sources/u-boot-qoriq
devtool modify u-boot-qoriq --no-overrides

To change the U-Boot console port, I modified this file in my workspace:  configs/ls1028ardb_tfa_defconfig

and added this line at the bottom of the file to move the U-Boot console to UART2 on the dev board.

CONFIG_CONS_INDEX=2

I did a bitbake u-boot-qoriq and then bitbaked our image.  It worked and U-Boot console was now on UART2!

Next, I made the changes to move the Linux console to the UART2 port on the dev board.  I edited my include/configs/ls1028ardb.h file in my workspace, changing:

"bootargs=console=ttyS0,115200\0" \

to be:

"bootargs=console=ttyS1,115200 earlycon=uart8250,mmio,0x21c0600\0" \

I again bitbaked u-boot-qoriq and then our image, and now both the U-Boot console and the Linux console are relocated to UART2 on the dev board.

 

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,992 次查看
jrevans
Contributor III

Well, I figured out the solution with a co-workers assistance.

First off, my build environment was corrupted and for whatever reason, some of the changes that I made did not get put into my Yocto image. It was odd, as I could change the ls1028ardb.h file and the change took effect, but changing the fsl-ls1028a-rdb.dts file or the ls1028ardb_tfa_defconfig file did not take effect.  The joys of Yocto.  When I looked at the build/tmp/work/blah... directory, my changes to defconfig did not appear in the .config file.  To fix that, I had to abandon my changes and reset devtool.

From the build directory:

devtool reset u-boot-qoriq
rm -rf ../sources/workspace/sources/u-boot-qoriq
devtool modify u-boot-qoriq --no-overrides

To change the U-Boot console port, I modified this file in my workspace:  configs/ls1028ardb_tfa_defconfig

and added this line at the bottom of the file to move the U-Boot console to UART2 on the dev board.

CONFIG_CONS_INDEX=2

I did a bitbake u-boot-qoriq and then bitbaked our image.  It worked and U-Boot console was now on UART2!

Next, I made the changes to move the Linux console to the UART2 port on the dev board.  I edited my include/configs/ls1028ardb.h file in my workspace, changing:

"bootargs=console=ttyS0,115200\0" \

to be:

"bootargs=console=ttyS1,115200 earlycon=uart8250,mmio,0x21c0600\0" \

I again bitbaked u-boot-qoriq and then our image, and now both the U-Boot console and the Linux console are relocated to UART2 on the dev board.

 

0 项奖励
回复
2,040 次查看
jrevans
Contributor III

I still cannot figure out how to change the default serial device that U-Boot uses for its console....

I've been looking at and making changes to the device tree files (fsl-ls1028a-rdb.dts and the related include files), the defconfig file, and the ls1028ardb.h file, but I cannot get the U-Boot console to move from UART1 on the dev board.

Can anybody provide me some guidance?

Surely there is a simple way to accomplish the task of moving the U-Boot console port.

0 项奖励
回复
2,031 次查看
jrevans
Contributor III

Looking at the u-boot-qoriq/doc/README.console file, it says:

 

 

If not defined in the environment, the first input device is assigned
to the 'stdin' file, the first output one to 'stdout' and 'stderr'.

 

 

I don't see the console defined in the environment, and when I try to define it, it doesn't seem to work. 

In what context does that README file refer to the first input device being assigned?  I tried changing the order of the ports around in the fsl-ls1028a-rdb.dts and fsl-ls1028a.dtsi files, but I still get the U-Boot console on the dev board's UART1 connector.  Is there someplace else that I would change the order of the ports to effect the first input/output device to be assigned?

0 项奖励
回复
2,125 次查看
jrevans
Contributor III

Unfortunately, those were not of any help. 

This part of the one link:  https://developer.toradex.com/software/development-resources/configuring-serial-port-debug-console-l...

Specifically says:  

Change the Debug UART (Serial Console) to Another Port

We don't provide instructions on how to do this. We advise you to use either the default Debug Port defined by Toradex or NXP.

I was really thinking that changing the "chosen" section in fsl-ls1028a-rdb.dts to specify serial1 instead of serial0 would have done what I wanted, but it does not.

 

0 项奖励
回复