Skip to contentSkip to conversation

Convert xtfpga U-Boot platform to DM_SERIAL

DISCUSSION Tom Rini 2 participants 3 messages May 1, 2025 – May 5, 2025

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

Hey,

Does anyone have time and knowledge to convert the xtfpga platform to using DM_SERIAL in U-Boot? It wasn't just a trivial enable CONFIG_DM_SERIAL and have success so I didn't look harder than that yet. Thanks!

Signature · 1 line
Tom
#1 lore raw

Hi Tom,

Quoted 3 lines · Tom Rini

Does anyone have time and knowledge to convert the xtfpga platform to using DM_SERIAL in U-Boot? It wasn't just a trivial enable CONFIG_DM_SERIAL and have success so I didn't look harder than that yet.

I was able to build working u-Boot for the kc705 xtfpga variant with the change below. I can submit a proper patch If it looks correct:
--8<--
From f0b6e632da8b72f0437a39dc1769b740fef04cf6 Mon Sep 17 00:00:00 2001
From: Max Filippov <[email protected]>
Date: Sun, 4 May 2025 18:40:44 -0700
Subject: [PATCH] WIP: xtensa: enable DM_SERIAL

---
 arch/Kconfig             | 1 +
 configs/xtfpga_defconfig | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
arch/Kconfig +1 -0
index 9bb3fe22402f..8d469a395f8c 100644
@@ -361,6 +361,7 @@ config X86
 config XTENSA
 	bool "Xtensa architecture"
 	select CREATE_ARCH_SYMLINK
+	select DM_SERIAL
 	select HAVE_PRIVATE_LIBGCC
 	select SUPPORT_LITTLE_ENDIAN
 	select SUPPORT_OF_CONTROL
configs/xtfpga_defconfig +4 -3
index b96dc10d85be..68656949660a 100644
@@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_LEN=0x40000
 CONFIG_SYS_MALLOC_F_LEN=0x400
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_SECT_SIZE=0x20000
+CONFIG_DEFAULT_DEVICE_TREE="kc705"
 CONFIG_SYS_MONITOR_LEN=262144
 CONFIG_SYS_LOAD_ADDR=0x02000000
 CONFIG_ENV_ADDR=0xF7FE0000
@@ -28,6 +29,8 @@ CONFIG_CMD_SAVES=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
@@ -46,7 +49,5 @@ CONFIG_SYS_FLASH_CFI=y
 CONFIG_SYS_MAX_FLASH_SECT=1027
 CONFIG_PHYLIB=y
 CONFIG_ETHOC=y
-CONFIG_SYS_NS16550_SERIAL=y
-CONFIG_SYS_NS16550_REG_SIZE=-4
+CONFIG_SYS_NS16550=y
 CONFIG_SYSRESET=y
-CONFIG_OF_LIBFDT=y
Signature · 2 lines
Thanks.
-- Max
author
#2 lore raw
Quoted 55 lines · Max Filippov

Hi Tom,

Quoted 3 lines · Tom Rini

Does anyone have time and knowledge to convert the xtfpga platform to using DM_SERIAL in U-Boot? It wasn't just a trivial enable CONFIG_DM_SERIAL and have success so I didn't look harder than that yet.

I was able to build working u-Boot for the kc705 xtfpga variant with the change below. I can submit a proper patch If it looks correct:
--8<--
From f0b6e632da8b72f0437a39dc1769b740fef04cf6 Mon Sep 17 00:00:00 2001
From: Max Filippov <[email protected]>
Date: Sun, 4 May 2025 18:40:44 -0700
Subject: [PATCH] WIP: xtensa: enable DM_SERIAL

---
 arch/Kconfig             | 1 +
 configs/xtfpga_defconfig | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
arch/Kconfig +1 -0
index 9bb3fe22402f..8d469a395f8c 100644
@@ -361,6 +361,7 @@ config X86
 config XTENSA
 	bool "Xtensa architecture"
 	select CREATE_ARCH_SYMLINK
+	select DM_SERIAL
 	select HAVE_PRIVATE_LIBGCC
 	select SUPPORT_LITTLE_ENDIAN
 	select SUPPORT_OF_CONTROL
configs/xtfpga_defconfig +3 -0
index b96dc10d85be..68656949660a 100644
@@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_LEN=0x40000
 CONFIG_SYS_MALLOC_F_LEN=0x400
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_SECT_SIZE=0x20000
+CONFIG_DEFAULT_DEVICE_TREE="kc705"
 CONFIG_SYS_MONITOR_LEN=262144
 CONFIG_SYS_LOAD_ADDR=0x02000000
 CONFIG_ENV_ADDR=0xF7FE0000
@@ -28,6 +29,8 @@ CONFIG_CMD_SAVES=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"

configs/xtfpga_defconfig CONFIG_SYS_FLASH_CFI=y · line 52

Quoted 8 lines
configs/xtfpga_defconfig +1 -3
@@ -46,7 +49,5 @@ CONFIG_SYS_FLASH_CFI=y
 CONFIG_SYS_MAX_FLASH_SECT=1027
 CONFIG_PHYLIB=y
 CONFIG_ETHOC=y
-CONFIG_SYS_NS16550_SERIAL=y
-CONFIG_SYS_NS16550_REG_SIZE=-4
+CONFIG_SYS_NS16550=y
 CONFIG_SYSRESET=y
-CONFIG_OF_LIBFDT=y

Looks about right to me, thanks!

Signature · 1 line
Tom