From patchwork Wed Nov 18 13:44:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Chou X-Patchwork-Id: 545997 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 03E77141493 for ; Thu, 19 Nov 2015 00:45:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EDD014B826; Wed, 18 Nov 2015 14:45:27 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0WodF37AHSP0; Wed, 18 Nov 2015 14:45:27 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AC40A4B7ED; Wed, 18 Nov 2015 14:45:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 27C974B7DE for ; Wed, 18 Nov 2015 14:45:09 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08UkgDOIapON for ; Wed, 18 Nov 2015 14:45:09 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from www.wytron.com.tw (220-134-43-68.HINET-IP.hinet.net [220.134.43.68]) by theia.denx.de (Postfix) with ESMTP id 52FE74B7E5 for ; Wed, 18 Nov 2015 14:45:05 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.1.250]) by www.wytron.com.tw (Postfix) with ESMTP id 4D816D00365; Wed, 18 Nov 2015 21:45:03 +0800 (CST) From: Thomas Chou To: u-boot@lists.denx.de Date: Wed, 18 Nov 2015 21:44:50 +0800 Message-Id: <1447854299-23680-5-git-send-email-thomas@wytron.com.tw> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1447854299-23680-1-git-send-email-thomas@wytron.com.tw> References: <1447684616-10297-1-git-send-email-thomas@wytron.com.tw> <1447854299-23680-1-git-send-email-thomas@wytron.com.tw> Cc: Marek Vasut , Tom Rini , clsee@altera.com, Tom Warren , lftan@altera.com Subject: [U-Boot] [PATCH v2 04/13] ns16550: unify serial_x86 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Unify serial_x86, and use the generic binding. Signed-off-by: Thomas Chou Reviewed-by: Tom Rini Reviewed-by: Bin Meng --- arch/x86/dts/serial.dtsi | 2 +- configs/efi-x86_defconfig | 2 +- drivers/serial/Kconfig | 11 +---------- drivers/serial/Makefile | 1 - drivers/serial/serial_x86.c | 44 -------------------------------------------- 5 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 drivers/serial/serial_x86.c diff --git a/arch/x86/dts/serial.dtsi b/arch/x86/dts/serial.dtsi index 6865eed..54c3faf 100644 --- a/arch/x86/dts/serial.dtsi +++ b/arch/x86/dts/serial.dtsi @@ -1,6 +1,6 @@ / { serial: serial { - compatible = "x86-uart"; + compatible = "ns16550"; reg = <0x3f8 8>; reg-shift = <0>; clock-frequency = <1843200>; diff --git a/configs/efi-x86_defconfig b/configs/efi-x86_defconfig index 43fb0c4..b1573df 100644 --- a/configs/efi-x86_defconfig +++ b/configs/efi-x86_defconfig @@ -3,6 +3,7 @@ CONFIG_VENDOR_EFI=y CONFIG_DEFAULT_DEVICE_TREE="efi" CONFIG_TARGET_EFI=y CONFIG_TSC_CALIBRATION_BYPASS=y +# CONFIG_NS16550_SERIAL is not set # CONFIG_CMD_BOOTM is not set # CONFIG_CMD_NET is not set CONFIG_OF_CONTROL=y @@ -12,5 +13,4 @@ CONFIG_DEBUG_UART=y CONFIG_DEBUG_EFI_CONSOLE=y CONFIG_DEBUG_UART_BASE=0 CONFIG_DEBUG_UART_CLOCK=0 -# CONFIG_X86_SERIAL is not set CONFIG_EFI=y diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 0f0e92d..93faa4c 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -198,6 +198,7 @@ config ROCKCHIP_SERIAL config NS16550_SERIAL bool "NS16550 UART or compatible" depends on DM_SERIAL + default y if X86 help Support NS16550 UART or compatible with driver model. This can be enabled in the device tree with the correct input clock frequency. @@ -233,14 +234,4 @@ config UNIPHIER_SERIAL If you have a UniPhier based board and want to use the on-chip serial ports, say Y to this option. If unsure, say N. -config X86_SERIAL - bool "Support for 16550 serial port on x86 machines" - depends on X86 - default y - help - Most x86 machines have a ns16550 UART or compatible. This can be - enabled in the device tree with the correct input clock frequency - provided (default 1843200). Enable this to obtain serial console - output. - endmenu diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index 1818c7c..9036a8e 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -46,7 +46,6 @@ obj-$(CONFIG_ARC_SERIAL) += serial_arc.o obj-$(CONFIG_TEGRA_SERIAL) += serial_tegra.o obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o obj-$(CONFIG_OMAP_SERIAL) += serial_omap.o -obj-$(CONFIG_X86_SERIAL) += serial_x86.o obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o ifndef CONFIG_SPL_BUILD diff --git a/drivers/serial/serial_x86.c b/drivers/serial/serial_x86.c deleted file mode 100644 index 4bf6062..0000000 --- a/drivers/serial/serial_x86.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2014 Google, Inc - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -static const struct udevice_id x86_serial_ids[] = { - { .compatible = "x86-uart" }, - { } -}; - -static int x86_serial_ofdata_to_platdata(struct udevice *dev) -{ - struct ns16550_platdata *plat = dev_get_platdata(dev); - int ret; - - ret = ns16550_serial_ofdata_to_platdata(dev); - if (ret) - return ret; - - plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset, - "clock-frequency", 1843200); - - return 0; -} - -U_BOOT_DRIVER(serial_ns16550) = { - .name = "serial_x86", - .id = UCLASS_SERIAL, - .of_match = x86_serial_ids, - .ofdata_to_platdata = x86_serial_ofdata_to_platdata, - .platdata_auto_alloc_size = sizeof(struct ns16550_platdata), - .priv_auto_alloc_size = sizeof(struct NS16550), - .probe = ns16550_serial_probe, - .ops = &ns16550_serial_ops, -};