From patchwork Wed Nov 18 13:44:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Chou X-Patchwork-Id: 545999 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 8796D141493 for ; Thu, 19 Nov 2015 00:46:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6085B4B807; Wed, 18 Nov 2015 14:45:54 +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 x8crVMD0jebq; Wed, 18 Nov 2015 14:45:54 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E36824B81B; Wed, 18 Nov 2015 14:45:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 61BEE4B803 for ; Wed, 18 Nov 2015 14:45:12 +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 mEYqVRtTsr4p for ; Wed, 18 Nov 2015 14:45:12 +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 530394B7EC for ; Wed, 18 Nov 2015 14:45:11 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.1.250]) by www.wytron.com.tw (Postfix) with ESMTP id A496DD00367; 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:51 +0800 Message-Id: <1447854299-23680-6-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 05/13] ns16550: unify serial_ppc 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_ppc, and use the generic binding. Signed-off-by: Thomas Chou Reviewed-by: Tom Rini --- arch/powerpc/include/asm/config.h | 4 ++++ drivers/serial/Kconfig | 2 +- drivers/serial/Makefile | 1 - drivers/serial/serial_ppc.c | 40 --------------------------------------- 4 files changed, 5 insertions(+), 42 deletions(-) delete mode 100644 drivers/serial/serial_ppc.c diff --git a/arch/powerpc/include/asm/config.h b/arch/powerpc/include/asm/config.h index 65496d0..7391066 100644 --- a/arch/powerpc/include/asm/config.h +++ b/arch/powerpc/include/asm/config.h @@ -104,4 +104,8 @@ /* All PPC boards must swap IDE bytes */ #define CONFIG_IDE_SWAP_IO +#if defined(CONFIG_DM_SERIAL) +#define CONFIG_SYS_NS16550_CLK get_serial_clock() +#endif + #endif /* _ASM_CONFIG_H_ */ diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 93faa4c..b41f508 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -198,7 +198,7 @@ config ROCKCHIP_SERIAL config NS16550_SERIAL bool "NS16550 UART or compatible" depends on DM_SERIAL - default y if X86 + default y if X86 || PPC help Support NS16550 UART or compatible with driver model. This can be enabled in the device tree with the correct input clock frequency. diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index 9036a8e..9f61113 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -8,7 +8,6 @@ ifdef CONFIG_DM_SERIAL obj-y += serial-uclass.o obj-$(CONFIG_PL01X_SERIAL) += serial_pl01x.o -obj-$(CONFIG_PPC) += serial_ppc.o else obj-y += serial.o obj-$(CONFIG_PL010_SERIAL) += serial_pl01x.o diff --git a/drivers/serial/serial_ppc.c b/drivers/serial/serial_ppc.c deleted file mode 100644 index 47141c6..0000000 --- a/drivers/serial/serial_ppc.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014 Google, Inc - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include - -static const struct udevice_id ppc_serial_ids[] = { - { .compatible = "ns16550" }, - { } -}; - -static int ppc_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 = get_serial_clock(); - - return 0; -} - -U_BOOT_DRIVER(serial_ns16550) = { - .name = "serial_ppc", - .id = UCLASS_SERIAL, - .of_match = ppc_serial_ids, - .ofdata_to_platdata = ppc_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, - .flags = DM_FLAG_PRE_RELOC, -};