Skip to contentSkip to conversation

ns16650: Correct CONFIG_SYS_NS16550_MEM32 platforms

PATCH In review Tom Rini 2 participants 3 messages Jan 6, 2023 – Jan 9, 2023

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 ns16650: Correct CONFIG_SYS_NS16550_MEM32 platforms

There are currently no platform that are both CONFIG_SYS_NS16550_MEM32 and not (per how the logic was prior to being broken in 0478dac62a9a ("kbuild: Remove uncmd_spl logic")) enabled in CONFIG_DM_SERIAL. We drop this line out now so that platforms which do use CONFIG_SYS_NS16550_MEM32 and depending on stage may or may not have DM_SERIAL set.

Fixes 0478dac62a9a ("kbuild: Remove uncmd_spl logic")
---
 include/ns16550.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/ns16550.h +2 -4
index f45fc8cecc56..243226fc3d94 100644
@@ -34,12 +34,10 @@
 #define CONFIG_SYS_NS16550_REG_SIZE (-1)
 #endif
 
-#ifdef CONFIG_NS16550_DYNAMIC
+#if defined(CONFIG_NS16550_DYNAMIC) || defined(CONFIG_DEBUG_UART)
 #define UART_REG(x)	unsigned char x
 #else
-#if defined(CONFIG_SYS_NS16550_MEM32) && !CONFIG_IS_ENABLED(DM_SERIAL)
-#define UART_REG(x) u32 x
-#elif !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0)
+#if !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0)
 #error "Please define NS16550 registers size."
 #elif (CONFIG_SYS_NS16550_REG_SIZE > 0)
 #define UART_REG(x)						   \
Signature · 1 line
2.25.1
Tested-by on v1 1/1
#1 lore raw

Hi Tom,

Quoted 24 lines · Tom Rini

There are currently no platform that are both CONFIG_SYS_NS16550_MEM32 and not (per how the logic was prior to being broken in 0478dac62a9a ("kbuild: Remove uncmd_spl logic")) enabled in CONFIG_DM_SERIAL. We drop this line out now so that platforms which do use CONFIG_SYS_NS16550_MEM32 and depending on stage may or may not have DM_SERIAL set.

Fixes 0478dac62a9a ("kbuild: Remove uncmd_spl logic")
---
  include/ns16550.h | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
include/ns16550.h +0 -1
index f45fc8cecc56..243226fc3d94 100644
@@ -34,12 +34,10 @@
  #define CONFIG_SYS_NS16550_REG_SIZE (-1)
  #endif
 
-#ifdef CONFIG_NS16550_DYNAMIC

include/ns16550.h line 43

Quoted 10 lines
include/ns16550.h +2 -3
+#if defined(CONFIG_NS16550_DYNAMIC) || defined(CONFIG_DEBUG_UART)
  #define UART_REG(x)	unsigned char x
  #else
-#if defined(CONFIG_SYS_NS16550_MEM32) && !CONFIG_IS_ENABLED(DM_SERIAL)
-#define UART_REG(x) u32 x
-#elif !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0)
+#if !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0)
  #error "Please define NS16550 registers size."
  #elif (CONFIG_SYS_NS16550_REG_SIZE > 0)
  #define UART_REG(x)						   \

This means though that we assume all ns16550 implementations have their register value stored in a byte only, either LSB or MSB of a 1-4 byte-wide register (which can (sometimes) be configured with CONFIG_SYS_NS16550_REG_SIZE).

In any case,

I really appreciate you taking the time to debug and suggest a patch, thanks a ton.

Cheers,
Quentin

author
#2 lore raw
In reply to Tom Rini
Quoted 11 lines · Tom Rini

There are currently no platform that are both CONFIG_SYS_NS16550_MEM32 and not (per how the logic was prior to being broken in 0478dac62a9a ("kbuild: Remove uncmd_spl logic")) enabled in CONFIG_DM_SERIAL. We drop this line out now so that platforms which do use CONFIG_SYS_NS16550_MEM32 and depending on stage may or may not have DM_SERIAL set.

Fixes 0478dac62a9a ("kbuild: Remove uncmd_spl logic")

Applied to u-boot/master, thanks!

Signature · 1 line
Tom