[RFC PATCH] tools: termios_linux.h: Fix build error on ppc64

Tom Rini trini at konsulko.com
Fri Jun 27 15:59:36 CEST 2025


On Fri, Jun 27, 2025 at 03:53:37PM +0200, Javier Martinez Canillas wrote:

> Commit 93b55636b09f ("tools: kwboot: Allow any baudrate on Linux") added a
> tcgetattr() function to be used, instead of the libc's termios functions.
> 
> This was done to allow using the raw TCGETS2/TCSETS2 ioctls that allow to
> support arbitrary baud rates.
> 
> This breaks the build for PowerPC, because that architecture does not have
> a struct termios2 defined becuase the termios and ktermios are the same.
> 
> On PowerPC, the termios ioctl() emulates the TCGETS2/TCSETS*2 ioctls with
> tcgetattr/tcsetattr using just the struct termios (that's as mentioned the
> same than what is defined as struct termios2 in other architectures).
> 
> So there is no need to use the TCGETS2/TCSETS2 ioctls on that architecture
> and just TCGETS/TCSETS ioctls with termios as defined by PowerPC is enough.
> 
> Fixes: 93b55636b09f ("tools: kwboot: Allow any baudrate on Linux")
> Signed-off-by: Javier Martinez Canillas <javierm at redhat.com>

Until someone can test this very specific combination of things on a
ppc64le host, this is probably reasonable enough.

Reviewed-by: Tom Rini <trini at konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250627/acd32a36/attachment.sig>


More information about the U-Boot mailing list