u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] ns16650: Correct CONFIG_SYS_NS16550_MEM32 platforms
@ 2023-01-06  3:47 Tom Rini
  2023-01-09  9:37 ` quentin.schulz
  2023-01-09 18:46 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Rini @ 2023-01-06  3:47 UTC (permalink / raw)
  To: u-boot; +Cc: Quentin Schulz

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")
Reported-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 include/ns16550.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/ns16550.h b/include/ns16550.h
index f45fc8cecc56..243226fc3d94 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -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)						   \
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ns16650: Correct CONFIG_SYS_NS16550_MEM32 platforms
  2023-01-06  3:47 [PATCH] ns16650: Correct CONFIG_SYS_NS16550_MEM32 platforms Tom Rini
@ 2023-01-09  9:37 ` quentin.schulz
  2023-01-09 18:46 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: quentin.schulz @ 2023-01-09  9:37 UTC (permalink / raw)
  To: Tom Rini, u-boot

Hi Tom,

On 1/6/23 4:47 AM, Tom Rini <trini@konsulko.com> wrote:
> 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")
> Reported-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>   include/ns16550.h | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/include/ns16550.h b/include/ns16550.h
> index f45fc8cecc56..243226fc3d94 100644
> --- a/include/ns16550.h
> +++ b/include/ns16550.h
> @@ -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)						   \
> 

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,
Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> #on Ringneck PX30, Puma RK3399

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

Cheers,
Quentin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ns16650: Correct CONFIG_SYS_NS16550_MEM32 platforms
  2023-01-06  3:47 [PATCH] ns16650: Correct CONFIG_SYS_NS16550_MEM32 platforms Tom Rini
  2023-01-09  9:37 ` quentin.schulz
@ 2023-01-09 18:46 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2023-01-09 18:46 UTC (permalink / raw)
  To: u-boot; +Cc: Quentin Schulz

[-- Attachment #1: Type: text/plain, Size: 752 bytes --]

On Thu, Jan 05, 2023 at 10:47:44PM -0500, Tom Rini wrote:

> 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")
> Reported-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> #on Ringneck PX30, Puma RK3399

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-09 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06  3:47 [PATCH] ns16650: Correct CONFIG_SYS_NS16550_MEM32 platforms Tom Rini
2023-01-09  9:37 ` quentin.schulz
2023-01-09 18:46 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).