From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 097BBC433FE for ; Sat, 19 Nov 2022 23:49:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D37318528D; Sun, 20 Nov 2022 00:46:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="tURE0mpB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BB1A285221; Sun, 20 Nov 2022 00:46:06 +0100 (CET) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CE4CA84F3C for ; Sun, 20 Nov 2022 00:45:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x72e.google.com with SMTP id d8so5897525qki.13 for ; Sat, 19 Nov 2022 15:45:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=46Q0b0KfUHN3PPVO0V2MX4XAsxVpDfTUUWJ+AmRIHrI=; b=tURE0mpBURc8xcPlISX3koqe4UjCyWC8Jbz96vlN4tfQIc8QnifwTkAnmnB2MJ+LTh 9Olic/SuspY4P1V11Wc8C5Zqzvebr9AzHQIckcZEwLp+eabwEGwzQewFwayU/1Autjrw 94rJbAgRxoJvcryKnCbrRp4fw290Ae07FgJ70= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=46Q0b0KfUHN3PPVO0V2MX4XAsxVpDfTUUWJ+AmRIHrI=; b=c2gvloeYPCUJgiS8Aw4Dkd/mpd2BtxaKpNSeJ1n8ES2kOWVYMLqF7U/LY67a7n7E5r V3xtS3JgqscAKraf2mKrunBo8ULGGfCxHl9jzVjW+AH3nLw4Ym8OlfjMmK7vhviAikAl Ci+EPveoMA6plIhlDYll5S7bvGr4Xcj0BPviAdumfkOHyzaT1M0VEA/1C1E1FP125X6a V6Y+TR16jvFELZdOaN2ok3UGlkoog1Gagyt2IYVC073A/grCX+lWKTGq8oOjLOfXcrY/ Mue979aZglX1bzeuE6c8fK5linziuesm+84e4J1iaVATb+8WZQGK437WnGt94VQtgGXH WTCw== X-Gm-Message-State: ANoB5pkmRWyg8h3DON/x4tk1G4CO6ExpGYHqSZmWCBXpcP473a7Kex1a r/uNlFWY9QGdp8C3rUQZuiK1wXhM+QnNyA== X-Google-Smtp-Source: AA0mqf7rzJhxWrWze656YuHcoZrWZkp9VY8qxDL6rlvzz0r0D2gBVpi7A/fK4jBI7nECOTGLH/RVfg== X-Received: by 2002:a37:bc84:0:b0:6fa:442c:af15 with SMTP id m126-20020a37bc84000000b006fa442caf15mr11300319qkf.456.1668901556333; Sat, 19 Nov 2022 15:45:56 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-55ec-b699-c19f-3363.res6.spectrum.com. [2603:6081:7b00:6400:55ec:b699:c19f:3363]) by smtp.gmail.com with ESMTPSA id y11-20020a37f60b000000b006ce1bfbd603sm5169743qkj.124.2022.11.19.15.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Nov 2022 15:45:56 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Cc: Trevor Woerner Subject: [PATCH 17/38] arm: lpc32xx: Remove unused hsuart driver Date: Sat, 19 Nov 2022 18:45:24 -0500 Message-Id: <20221119234545.404563-17-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221119234545.404563-1-trini@konsulko.com> References: <20221119234545.404563-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This driver is not enabled in any config currently, remove it. Cc: Trevor Woerner Signed-off-by: Tom Rini --- I ran in to this as CONFIG_LPC32XX_HSUART is not in Kconfig, so doing that migration would be another path forward here. --- arch/arm/include/asm/arch-lpc32xx/config.h | 8 -- arch/arm/mach-lpc32xx/devices.c | 16 --- drivers/serial/Makefile | 1 - drivers/serial/lpc32xx_hsuart.c | 112 --------------------- include/dm/platform_data/lpc32xx_hsuart.h | 18 ---- 5 files changed, 155 deletions(-) delete mode 100644 drivers/serial/lpc32xx_hsuart.c delete mode 100644 include/dm/platform_data/lpc32xx_hsuart.h diff --git a/arch/arm/include/asm/arch-lpc32xx/config.h b/arch/arm/include/asm/arch-lpc32xx/config.h index 3ad78cb1e645..41160384a4dc 100644 --- a/arch/arm/include/asm/arch-lpc32xx/config.h +++ b/arch/arm/include/asm/arch-lpc32xx/config.h @@ -11,14 +11,6 @@ /* Basic CPU architecture */ -/* UART configuration */ -#if (CONFIG_CONS_INDEX == 1) || (CONFIG_CONS_INDEX == 2) || \ - (CONFIG_CONS_INDEX == 7) -#if !defined(CONFIG_LPC32XX_HSUART) -#define CONFIG_LPC32XX_HSUART -#endif -#endif - #if !defined(CFG_SYS_NS16550_CLK) #define CFG_SYS_NS16550_CLK 13000000 #endif diff --git a/arch/arm/mach-lpc32xx/devices.c b/arch/arm/mach-lpc32xx/devices.c index 3fcf8facb411..6a67a3591aa6 100644 --- a/arch/arm/mach-lpc32xx/devices.c +++ b/arch/arm/mach-lpc32xx/devices.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include @@ -53,26 +52,11 @@ static const struct ns16550_plat lpc32xx_uart[] = { .clock = CFG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, }; -#if defined(CONFIG_LPC32XX_HSUART) -static const struct lpc32xx_hsuart_plat lpc32xx_hsuart[] = { - { HS_UART1_BASE, }, - { HS_UART2_BASE, }, - { HS_UART7_BASE, }, -}; -#endif - U_BOOT_DRVINFOS(lpc32xx_uarts) = { -#if defined(CONFIG_LPC32XX_HSUART) - { "lpc32xx_hsuart", &lpc32xx_hsuart[0], }, - { "lpc32xx_hsuart", &lpc32xx_hsuart[1], }, -#endif { "ns16550_serial", &lpc32xx_uart[0], }, { "ns16550_serial", &lpc32xx_uart[1], }, { "ns16550_serial", &lpc32xx_uart[2], }, { "ns16550_serial", &lpc32xx_uart[3], }, -#if defined(CONFIG_LPC32XX_HSUART) - { "lpc32xx_hsuart", &lpc32xx_hsuart[2], }, -#endif }; #endif diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index eb7b8f23ee90..a26eb16634a0 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -38,7 +38,6 @@ obj-$(CONFIG_COREBOOT_SERIAL) += serial_coreboot.o obj-$(CONFIG_CORTINA_UART) += serial_cortina.o obj-$(CONFIG_DEBUG_SBI_CONSOLE) += serial_sbi.o obj-$(CONFIG_EFI_APP) += serial_efi.o -obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o obj-$(CONFIG_MCFUART) += serial_mcf.o obj-$(CONFIG_SYS_NS16550) += ns16550.o obj-$(CONFIG_S5P_SERIAL) += serial_s5p.o diff --git a/drivers/serial/lpc32xx_hsuart.c b/drivers/serial/lpc32xx_hsuart.c deleted file mode 100644 index d39a3c0494ea..000000000000 --- a/drivers/serial/lpc32xx_hsuart.c +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright (C) 2011-2015 Vladimir Zapolskiy - */ - -#include -#include -#include -#include -#include - -#include -#include - -struct lpc32xx_hsuart_priv { - struct hsuart_regs *hsuart; -}; - -static int lpc32xx_serial_setbrg(struct udevice *dev, int baudrate) -{ - struct lpc32xx_hsuart_priv *priv = dev_get_priv(dev); - struct hsuart_regs *hsuart = priv->hsuart; - u32 div; - - /* UART rate = PERIPH_CLK / ((HSU_RATE + 1) x 14) */ - div = (get_serial_clock() / 14 + baudrate / 2) / baudrate - 1; - if (div > 255) - div = 255; - - writel(div, &hsuart->rate); - - return 0; -} - -static int lpc32xx_serial_getc(struct udevice *dev) -{ - struct lpc32xx_hsuart_priv *priv = dev_get_priv(dev); - struct hsuart_regs *hsuart = priv->hsuart; - - if (!(readl(&hsuart->level) & HSUART_LEVEL_RX)) - return -EAGAIN; - - return readl(&hsuart->rx) & HSUART_RX_DATA; -} - -static int lpc32xx_serial_putc(struct udevice *dev, const char c) -{ - struct lpc32xx_hsuart_priv *priv = dev_get_priv(dev); - struct hsuart_regs *hsuart = priv->hsuart; - - /* Wait for empty FIFO */ - if (readl(&hsuart->level) & HSUART_LEVEL_TX) - return -EAGAIN; - - writel(c, &hsuart->tx); - - return 0; -} - -static int lpc32xx_serial_pending(struct udevice *dev, bool input) -{ - struct lpc32xx_hsuart_priv *priv = dev_get_priv(dev); - struct hsuart_regs *hsuart = priv->hsuart; - - if (input) { - if (readl(&hsuart->level) & HSUART_LEVEL_RX) - return 1; - } else { - if (readl(&hsuart->level) & HSUART_LEVEL_TX) - return 1; - } - - return 0; -} - -static int lpc32xx_serial_init(struct hsuart_regs *hsuart) -{ - /* Disable hardware RTS and CTS flow control, set up RX and TX FIFO */ - writel(HSUART_CTRL_TMO_16 | HSUART_CTRL_HSU_OFFSET(20) | - HSUART_CTRL_HSU_RX_TRIG_32 | HSUART_CTRL_HSU_TX_TRIG_0, - &hsuart->ctrl); - - return 0; -} - -static int lpc32xx_hsuart_probe(struct udevice *dev) -{ - struct lpc32xx_hsuart_plat *plat = dev_get_plat(dev); - struct lpc32xx_hsuart_priv *priv = dev_get_priv(dev); - - priv->hsuart = (struct hsuart_regs *)plat->base; - - lpc32xx_serial_init(priv->hsuart); - - return 0; -} - -static const struct dm_serial_ops lpc32xx_hsuart_ops = { - .setbrg = lpc32xx_serial_setbrg, - .getc = lpc32xx_serial_getc, - .putc = lpc32xx_serial_putc, - .pending = lpc32xx_serial_pending, -}; - -U_BOOT_DRIVER(lpc32xx_hsuart) = { - .name = "lpc32xx_hsuart", - .id = UCLASS_SERIAL, - .probe = lpc32xx_hsuart_probe, - .ops = &lpc32xx_hsuart_ops, - .priv_auto = sizeof(struct lpc32xx_hsuart_priv), - .flags = DM_FLAG_PRE_RELOC, -}; diff --git a/include/dm/platform_data/lpc32xx_hsuart.h b/include/dm/platform_data/lpc32xx_hsuart.h deleted file mode 100644 index 6f41e0e734a5..000000000000 --- a/include/dm/platform_data/lpc32xx_hsuart.h +++ /dev/null @@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (c) 2015 Vladimir Zapolskiy - */ - -#ifndef _LPC32XX_HSUART_PLAT_H -#define _LPC32XX_HSUART_PLAT_H - -/** - * struct lpc32xx_hsuart_plat - NXP LPC32xx HSUART platform data - * - * @base: Base register address - */ -struct lpc32xx_hsuart_plat { - unsigned long base; -}; - -#endif -- 2.25.1