All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86: serial: Use NS16550_DYNAMIC in Slim Bootloader
@ 2019-12-18  5:56 Park, Aiden
  2020-02-03  2:43 ` Bin Meng
  0 siblings, 1 reply; 3+ messages in thread
From: Park, Aiden @ 2019-12-18  5:56 UTC (permalink / raw)
  To: u-boot

Slim Bootloader provides serial port info in its HOB to support
both IO or MMIO serial ports, but it's controlled by SYS_NS16550_MEM32
or SYS_NS16550_PORT_MAPPED in U-Boot.
To support both serial port configurations dynamically at runtime,
Slim Bootloader serial driver leverages NS16550_DYNAMIC.

Signed-off-by: Aiden Park <aiden.park@intel.com>
---
 arch/x86/cpu/slimbootloader/serial.c |  5 +++++
 include/configs/slimbootloader.h     | 13 -------------
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/arch/x86/cpu/slimbootloader/serial.c b/arch/x86/cpu/slimbootloader/serial.c
index 7b44a59bff..0f45b3ba72 100644
--- a/arch/x86/cpu/slimbootloader/serial.c
+++ b/arch/x86/cpu/slimbootloader/serial.c
@@ -45,7 +45,12 @@ static int slimbootloader_serial_ofdata_to_platdata(struct udevice *dev)
 	plat->base = data->base;
 	/* ns16550 uses reg_shift, then covert stride to shift */
 	plat->reg_shift = data->stride >> 1;
+	plat->reg_width = data->stride;
 	plat->clock = data->clk;
+	plat->fcr = UART_FCR_DEFVAL;
+	plat->flags = 0;
+	if (data->type == 1)
+		plat->flags |= NS16550_FLAG_IO;
 
 	return 0;
 }
diff --git a/include/configs/slimbootloader.h b/include/configs/slimbootloader.h
index e0011ed446..b8169072cc 100644
--- a/include/configs/slimbootloader.h
+++ b/include/configs/slimbootloader.h
@@ -8,19 +8,6 @@
 
 #include <configs/x86-common.h>
 
-/*
- * By default, CONFIG_SYS_NS16550_PORT_MAPPED is enabled for port io serial.
- * To use mmio base serial, enable CONFIG_SYS_NS16550_MEM32 and disable
- * CONFIG_SYS_NS16550_PORT_MAPPED until ns16550 driver supports serial port
- * configuration in run-time.
- *
- * #define CONFIG_SYS_NS16550_MEM32
- * #undef CONFIG_SYS_NS16550_PORT_MAPPED
- */
-#ifdef CONFIG_SYS_NS16550_MEM32
-#undef CONFIG_SYS_NS16550_PORT_MAPPED
-#endif
-
 #define CONFIG_STD_DEVICES_SETTINGS		\
 	"stdin=serial,i8042-kbd,usbkbd\0"	\
 	"stdout=serial\0"			\
-- 
2.20.1

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

* [PATCH 1/2] x86: serial: Use NS16550_DYNAMIC in Slim Bootloader
  2019-12-18  5:56 [PATCH 1/2] x86: serial: Use NS16550_DYNAMIC in Slim Bootloader Park, Aiden
@ 2020-02-03  2:43 ` Bin Meng
  2020-02-03  2:48   ` Bin Meng
  0 siblings, 1 reply; 3+ messages in thread
From: Bin Meng @ 2020-02-03  2:43 UTC (permalink / raw)
  To: u-boot

Hi Aiden,

On Wed, Dec 18, 2019 at 1:56 PM Park, Aiden <aiden.park@intel.com> wrote:
>
> Slim Bootloader provides serial port info in its HOB to support
> both IO or MMIO serial ports, but it's controlled by SYS_NS16550_MEM32
> or SYS_NS16550_PORT_MAPPED in U-Boot.
> To support both serial port configurations dynamically at runtime,
> Slim Bootloader serial driver leverages NS16550_DYNAMIC.
>
> Signed-off-by: Aiden Park <aiden.park@intel.com>
> ---
>  arch/x86/cpu/slimbootloader/serial.c |  5 +++++
>  include/configs/slimbootloader.h     | 13 -------------
>  2 files changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/arch/x86/cpu/slimbootloader/serial.c b/arch/x86/cpu/slimbootloader/serial.c
> index 7b44a59bff..0f45b3ba72 100644
> --- a/arch/x86/cpu/slimbootloader/serial.c
> +++ b/arch/x86/cpu/slimbootloader/serial.c
> @@ -45,7 +45,12 @@ static int slimbootloader_serial_ofdata_to_platdata(struct udevice *dev)
>         plat->base = data->base;
>         /* ns16550 uses reg_shift, then covert stride to shift */
>         plat->reg_shift = data->stride >> 1;
> +       plat->reg_width = data->stride;
>         plat->clock = data->clk;
> +       plat->fcr = UART_FCR_DEFVAL;
> +       plat->flags = 0;
> +       if (data->type == 1)
> +               plat->flags |= NS16550_FLAG_IO;

nits: the following comments in this function should be removed:

/*
* The data->type provides port io or mmio access type info,
* but the access type will be controlled by
* CONFIG_SYS_NS16550_PORT_MAPPED or CONFIG_SYS_NS16550_MEM32.
*
* TBD: ns16550 access type configuration in runtime.
*      ex) plat->access_type = data->type
*/

>
>         return 0;
>  }
> diff --git a/include/configs/slimbootloader.h b/include/configs/slimbootloader.h
> index e0011ed446..b8169072cc 100644
> --- a/include/configs/slimbootloader.h
> +++ b/include/configs/slimbootloader.h
> @@ -8,19 +8,6 @@
>
>  #include <configs/x86-common.h>
>
> -/*
> - * By default, CONFIG_SYS_NS16550_PORT_MAPPED is enabled for port io serial.
> - * To use mmio base serial, enable CONFIG_SYS_NS16550_MEM32 and disable
> - * CONFIG_SYS_NS16550_PORT_MAPPED until ns16550 driver supports serial port
> - * configuration in run-time.
> - *
> - * #define CONFIG_SYS_NS16550_MEM32
> - * #undef CONFIG_SYS_NS16550_PORT_MAPPED
> - */
> -#ifdef CONFIG_SYS_NS16550_MEM32
> -#undef CONFIG_SYS_NS16550_PORT_MAPPED
> -#endif
> -
>  #define CONFIG_STD_DEVICES_SETTINGS            \
>         "stdin=serial,i8042-kbd,usbkbd\0"       \
>         "stdout=serial\0"                       \
> --

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Regards,
Bin

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

* [PATCH 1/2] x86: serial: Use NS16550_DYNAMIC in Slim Bootloader
  2020-02-03  2:43 ` Bin Meng
@ 2020-02-03  2:48   ` Bin Meng
  0 siblings, 0 replies; 3+ messages in thread
From: Bin Meng @ 2020-02-03  2:48 UTC (permalink / raw)
  To: u-boot

On Mon, Feb 3, 2020 at 10:43 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Aiden,
>
> On Wed, Dec 18, 2019 at 1:56 PM Park, Aiden <aiden.park@intel.com> wrote:
> >
> > Slim Bootloader provides serial port info in its HOB to support
> > both IO or MMIO serial ports, but it's controlled by SYS_NS16550_MEM32
> > or SYS_NS16550_PORT_MAPPED in U-Boot.
> > To support both serial port configurations dynamically at runtime,
> > Slim Bootloader serial driver leverages NS16550_DYNAMIC.
> >
> > Signed-off-by: Aiden Park <aiden.park@intel.com>
> > ---
> >  arch/x86/cpu/slimbootloader/serial.c |  5 +++++
> >  include/configs/slimbootloader.h     | 13 -------------
> >  2 files changed, 5 insertions(+), 13 deletions(-)
> >
> > diff --git a/arch/x86/cpu/slimbootloader/serial.c b/arch/x86/cpu/slimbootloader/serial.c
> > index 7b44a59bff..0f45b3ba72 100644
> > --- a/arch/x86/cpu/slimbootloader/serial.c
> > +++ b/arch/x86/cpu/slimbootloader/serial.c
> > @@ -45,7 +45,12 @@ static int slimbootloader_serial_ofdata_to_platdata(struct udevice *dev)
> >         plat->base = data->base;
> >         /* ns16550 uses reg_shift, then covert stride to shift */
> >         plat->reg_shift = data->stride >> 1;
> > +       plat->reg_width = data->stride;
> >         plat->clock = data->clk;
> > +       plat->fcr = UART_FCR_DEFVAL;
> > +       plat->flags = 0;
> > +       if (data->type == 1)
> > +               plat->flags |= NS16550_FLAG_IO;
>
> nits: the following comments in this function should be removed:
>
> /*
> * The data->type provides port io or mmio access type info,
> * but the access type will be controlled by
> * CONFIG_SYS_NS16550_PORT_MAPPED or CONFIG_SYS_NS16550_MEM32.
> *
> * TBD: ns16550 access type configuration in runtime.
> *      ex) plat->access_type = data->type
> */
>

Removed these obsolete comments, and

> >
> >         return 0;
> >  }
> > diff --git a/include/configs/slimbootloader.h b/include/configs/slimbootloader.h
> > index e0011ed446..b8169072cc 100644
> > --- a/include/configs/slimbootloader.h
> > +++ b/include/configs/slimbootloader.h
> > @@ -8,19 +8,6 @@
> >
> >  #include <configs/x86-common.h>
> >
> > -/*
> > - * By default, CONFIG_SYS_NS16550_PORT_MAPPED is enabled for port io serial.
> > - * To use mmio base serial, enable CONFIG_SYS_NS16550_MEM32 and disable
> > - * CONFIG_SYS_NS16550_PORT_MAPPED until ns16550 driver supports serial port
> > - * configuration in run-time.
> > - *
> > - * #define CONFIG_SYS_NS16550_MEM32
> > - * #undef CONFIG_SYS_NS16550_PORT_MAPPED
> > - */
> > -#ifdef CONFIG_SYS_NS16550_MEM32
> > -#undef CONFIG_SYS_NS16550_PORT_MAPPED
> > -#endif
> > -
> >  #define CONFIG_STD_DEVICES_SETTINGS            \
> >         "stdin=serial,i8042-kbd,usbkbd\0"       \
> >         "stdout=serial\0"                       \
> > --
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!

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

end of thread, other threads:[~2020-02-03  2:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18  5:56 [PATCH 1/2] x86: serial: Use NS16550_DYNAMIC in Slim Bootloader Park, Aiden
2020-02-03  2:43 ` Bin Meng
2020-02-03  2:48   ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.