[U-Boot] [PATCH v3 4/8] x86: slimbootloader: Add serial driver

Bin Meng bmeng.cn at gmail.com
Sun Jul 14 08:49:17 UTC 2019


On Wed, Jul 10, 2019 at 3:02 AM Park, Aiden <aiden.park at intel.com> wrote:
>
> Slim Bootloader provides serial port info thru its HOB list pointer.
> All these HOBs are eligible for Slim Bootloader based board only.
> - Get serial port information from the serial port info hob
> - Leverage ns16550 driver with slimbootloader specific platform data
>
> Signed-off-by: Aiden Park <aiden.park at intel.com>
> ---
>
> Changes in v3:
>   * Use HOB function from the common HOB library
>
>  arch/x86/cpu/slimbootloader/Makefile          |  2 +-
>  arch/x86/cpu/slimbootloader/serial.c          | 69 +++++++++++++++++++
>  .../asm/arch-slimbootloader/slimbootloader.h  | 36 ++++++++++
>  3 files changed, 106 insertions(+), 1 deletion(-)
>  create mode 100644 arch/x86/cpu/slimbootloader/serial.c
>
> diff --git a/arch/x86/cpu/slimbootloader/Makefile b/arch/x86/cpu/slimbootloader/Makefile
> index 05d0ca4a19..68c4a91955 100644
> --- a/arch/x86/cpu/slimbootloader/Makefile
> +++ b/arch/x86/cpu/slimbootloader/Makefile
> @@ -2,4 +2,4 @@
>  #
>  # Copyright (C) 2019 Intel Corporation <www.intel.com>
>
> -obj-y += car.o slimbootloader.o dram.o
> +obj-y += car.o slimbootloader.o dram.o serial.o
> diff --git a/arch/x86/cpu/slimbootloader/serial.c b/arch/x86/cpu/slimbootloader/serial.c
> new file mode 100644
> index 0000000000..84469a2ddf
> --- /dev/null
> +++ b/arch/x86/cpu/slimbootloader/serial.c
> @@ -0,0 +1,69 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (C) 2019 Intel Corporation <www.intel.com>
> + */
> +
> +#include <common.h>
> +#include <dm.h>
> +#include <ns16550.h>
> +#include <serial.h>
> +#include <asm/arch/slimbootloader.h>
> +
> +/**
> + * The serial port info hob is generated by Slim Bootloader, so eligible for
> + * Slim Bootloader based boards only.
> + */
> +int slimbootloader_serial_ofdata_to_platdata(struct udevice *dev)

This should be static.

> +{
> +       const struct efi_guid guid = LOADER_SERIAL_PORT_INFO_GUID;
> +       struct serial_port_info *serial_info = NULL;
> +       struct ns16550_platdata *plat = dev->platdata;
> +
> +       if (!gd->arch.hob_list)
> +               panic("hob list not found!");
> +

[snip]

Other than that,
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list