From patchwork Thu Mar 30 19:47:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 668613 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp115554wrt; Thu, 30 Mar 2023 12:51:26 -0700 (PDT) X-Google-Smtp-Source: AKy350a/WaRNBpfUEfdxu7vLJ/INjybfl56BQMpbItoNOOrqkMpVKx3XJFkwq1V4EkXFIWwHIj5Z X-Received: by 2002:a17:902:d04b:b0:1a1:dd05:39fa with SMTP id l11-20020a170902d04b00b001a1dd0539famr18398842pll.48.1680205886726; Thu, 30 Mar 2023 12:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680205886; cv=none; d=google.com; s=arc-20160816; b=WcUxN0ayECjVy1EOK1vLNNv1XdqtJUanYAuIyv1uUP5qw6Cw7yBR0wjydU2A485B2C nJN6BksurRzmfYMrhrcLr0ks1TI8LCvmnvEVhCAqQYvHzV4CF9Fd5MtgpHCFIsX2CKf3 lPPEeodB+s1TPokywooq9gWrZO8oIDQBhJgQ/+BpPjPPXbDHvVlkVfkPGrZIgv+l7E4X kBipSaxbBEP2/BuObYTLpnzk7iPVSkNelPmkKKCO5naxKX1M1bu9awetdhzuRZ/K3lWj q3ECEnrYj/RTl8jKTAggoxUHxqLespHKA9wwOTWEq8EUbQlHavoSef24Ty1C9LUylXcJ G0zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C51MK1KcefWJ36AuEHQetqDNKOl8igZ4IuAkCAatPeM=; b=n1ekUfqbReAxNCo7WVn4rRtGxGgroHp/uFQyvweOuEvhYwtHsS5qgke5dG9qKElmJ0 C+FDICfNIq9iLzkDObskC12L/FkSsodsG3eDtUkwUxIFPibWt/CqhzoB06TOdW4qMTou kQ0F3y1tzVGc4xmYgfYeTbW/2/jEZVlJ+H5MoB0UqfOM0svdmPWx3CXQGqjVSHTt0idV DLugPQ3sVnK31PlrXZ6yte0h5S4A36wQ0IoVmTT8+TnHKEpXcS6AlkF/vMiOzfMh9Ipx lshx5Q+B057CsDRHZ3ZLBH4UcnqDFq2ivjJenoZq63lM+VGMvOtdkamixXXNKSq3c4xq N/0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X7rq7jcf; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id u16-20020a63df10000000b005138c1f1fbbsi430985pgg.548.2023.03.30.12.51.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:51:26 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X7rq7jcf; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A42DF86182; Thu, 30 Mar 2023 21:51:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="X7rq7jcf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2986C85EF3; Thu, 30 Mar 2023 21:47:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (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 3D0A18574A for ; Thu, 30 Mar 2023 21:47:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vladimir.zapolskiy@linaro.org Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-29bd5a3f8d6so496301fa.1 for ; Thu, 30 Mar 2023 12:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680205661; 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=C51MK1KcefWJ36AuEHQetqDNKOl8igZ4IuAkCAatPeM=; b=X7rq7jcfIVUpFF3HIhkbZjmWHu6OIQZwvtQj4UDQla0h7jCBW7ojlSwE9/6jkCRGk5 u54H5yJhJ0spONstGtovHGRNA5uUMZt0Ce5RnEyBXgtdWsqOzImwXwAwFESOmD7tm1bz aDF2R3v44fYitggwMLdinrqjt3w149K2MFo+Uk8OSITtemkE8Oyt+y4gqEQHUXc7h5Ys KnBfyVx9GXozQS5Z55pnqr+4BXAgWhUkQD4knY9SfvzGFJRdKMr+BPa6fRjEgLRKcKJw aHqWo8F9DMeodxYVGzh72wXYuGPt/eXrEcCsFuTCjGQXKJBLMK+HZxLopptvxuDhn4k9 vPhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680205661; 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=C51MK1KcefWJ36AuEHQetqDNKOl8igZ4IuAkCAatPeM=; b=n7i0NYvONeQahNnK+A3oTNeXHd3aCwEOi3Y7jeUq+LavYJxDfhZOnGUMDHWyfhtE6s TLFfAqSKldjwFiA24KLXU6wPlOTOpbsHALFpzyixQQ1FoDmI7QonVvXRXDBVPCYBYXog otFDyp9FtA9Zsu7IVPQHDIECr71WvGHlkD2PGRMzU/mD412yoFenHR/7P2OblQx53riB BQJv/wiv7uc+e6Q28XSUcwue4mWPM40jLSVk835NWZKRlZC9WIQsQjt8wECSgw5/uy9U pg7OVxffH5PvBoO9QxonBd+G9IPTkJdGgq/ay6BQRFj9Bu0LGWtxa9tS+OilaSXv5KoO AkBA== X-Gm-Message-State: AAQBX9eGo4kQ2JvYyKKf4wBe1nB7zeZxE7DzuHWORAH2zO/qmLnRmaza PWkmOYjVS/wKQtgFgbhbJWFaXw== X-Received: by 2002:a2e:be85:0:b0:298:a8bc:b4d4 with SMTP id a5-20020a2ebe85000000b00298a8bcb4d4mr1169538ljr.4.1680205661325; Thu, 30 Mar 2023 12:47:41 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id i19-20020a2e8093000000b0029f3e2efbb9sm46674ljg.90.2023.03.30.12.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:47:40 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH 1/6] misc: add Qualcomm GENI SE QUP device driver Date: Thu, 30 Mar 2023 22:47:31 +0300 Message-Id: <20230330194736.2400593-2-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> References: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 30 Mar 2023 21:50:39 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean This change adds a Qualcomm GENI SE QUP device driver as a wrapper for actually enabled and used serial devices found on a board. At the moment the driver is pretty simple, its intention is to populate childred devices and provide I/O mem read interface to them as clients, this is needed for GENI UART driver to set up a proper clock divider and provide the actually asked baud rate. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Konrad Dybcio --- drivers/misc/Kconfig | 6 ++++++ drivers/misc/Makefile | 1 + drivers/misc/qcom-geni-se.c | 42 +++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 drivers/misc/qcom-geni-se.c diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index b5707a15c504..348e1ab407ad 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -511,6 +511,12 @@ config WINBOND_W83627 legacy UART or other devices in the Winbond Super IO chips on X86 platforms. +config QCOM_GENI_SE + bool "Qualcomm GENI Serial Engine Driver" + help + The driver manages Generic Interface (GENI) firmware based + Qualcomm Technologies, Inc. Universal Peripheral (QUP) Wrapper. + config QFW bool help diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 3b792f2a14ce..52aed096021f 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -60,6 +60,7 @@ obj-$(CONFIG_NUVOTON_NCT6102D) += nuvoton_nct6102d.o obj-$(CONFIG_P2SB) += p2sb-uclass.o obj-$(CONFIG_PCA9551_LED) += pca9551_led.o obj-$(CONFIG_$(SPL_)PWRSEQ) += pwrseq-uclass.o +obj-$(CONFIG_QCOM_GENI_SE) += qcom-geni-se.o ifdef CONFIG_QFW obj-y += qfw.o obj-$(CONFIG_QFW_PIO) += qfw_pio.o diff --git a/drivers/misc/qcom-geni-se.c b/drivers/misc/qcom-geni-se.c new file mode 100644 index 000000000000..4f1775b11f62 --- /dev/null +++ b/drivers/misc/qcom-geni-se.c @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm Generic Interface (GENI) Serial Engine (SE) Wrapper + * + * (C) Copyright 2023 Vladimir Zapolskiy + */ + +#include +#include +#include +#include + +static int geni_se_qup_read(struct udevice *dev, int offset, + void *buf, int size) +{ + fdt_addr_t base = dev_read_addr(dev); + + if (size != sizeof(u32)) + return -EINVAL; + + *(u32 *)buf = readl(base + offset); + + return 0; +} + +static struct misc_ops geni_se_qup_ops = { + .read = geni_se_qup_read, +}; + +static const struct udevice_id geni_se_qup_ids[] = { + { .compatible = "qcom,geni-se-qup" }, + {} +}; + +U_BOOT_DRIVER(geni_se_qup) = { + .name = "geni_se_qup", + .id = UCLASS_MISC, + .of_match = geni_se_qup_ids, + .bind = dm_scan_fdt_dev, + .ops = &geni_se_qup_ops, + .flags = DM_FLAG_PRE_RELOC, +}; From patchwork Thu Mar 30 19:47:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 668617 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp116464wrt; Thu, 30 Mar 2023 12:53:55 -0700 (PDT) X-Google-Smtp-Source: AKy350b8wKfTLXMkDEAHyvY/1FCCfaYGu3OkpCMLWWtEazQi1/DszqsZ8cn57VW67YZ9vawc+jLk X-Received: by 2002:a17:902:ce8a:b0:1a1:a8eb:d34d with SMTP id f10-20020a170902ce8a00b001a1a8ebd34dmr29373384plg.46.1680206035326; Thu, 30 Mar 2023 12:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680206035; cv=none; d=google.com; s=arc-20160816; b=J74Z2P1vrWR/pVUGKHn8p3UxiT8fVAPDBzC278IelnrDZdm+XYoNN28NYnoXMNmip7 SPFdibssmVQjWyjjoI/8uFEv3I+cm3aHHri6umon2H1qnc8p0yt8RKFiwZ0SWhVGFu+7 i58UEiBW7iDNCfwUX1KaOg0hOm49eG948FdUi6pri5yE5HxuTrlaRC4mwV4P2QYUKFE9 QkjbAeFVkMSeWeowRomzt8YV1vCiu/UziG/lH+f8IYGKgbdH5slAiounfVzlZ/rwWU3c yJRzUr8DCk0G+4N3esaox4b7r073WVCK015Ux21yBGrt6T/1axf+sOs9O0X36RvqAkEh q4UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0yzRJTK+hC1zirNLsI9dbg/pchZpukz5xu7JXlA0l3k=; b=SgntDc6itWlZBAU3Tl+9Bu5YtgPv94lLO+iZ+NTrln6swcYod661aCuv1a3Mi5Guu9 7mps7913z0rlh+y7M90no+Ol0kRbKa0Frp2NMaciJoViVLWVsk20xsTLkoSjvP92E9zt D8uOn84q7XB7I5/dgaQLiNIkFQbuHifkRMQN/PnYnKP19BCnEs8Ga1pCKvx511hYyaQ6 s76/LRX7t79h6PY4KkXfgnfJkNgxeZOcCiZm9kOGCZQdfw1RlZNstBBdGY2bkDLBhQPM /24iGUo7B5kE1feC1nHIjt1tHYC2HykDWfmHME7dZjzquMyLCbYsRZtV9TSbbqYAkNWD EwGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z9nTgZQX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id u18-20020a170902e5d200b0019cba5dd485si315512plf.358.2023.03.30.12.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:53:55 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z9nTgZQX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2AF1C8619B; Thu, 30 Mar 2023 21:52:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Z9nTgZQX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD0EA85DD9; Thu, 30 Mar 2023 21:47:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (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 5EFD885DD9 for ; Thu, 30 Mar 2023 21:47:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vladimir.zapolskiy@linaro.org Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2a5f619b4e2so330281fa.0 for ; Thu, 30 Mar 2023 12:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680205662; 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=0yzRJTK+hC1zirNLsI9dbg/pchZpukz5xu7JXlA0l3k=; b=Z9nTgZQXkvisLsjBBfJWOPybryZlSn+NW8mflXJwQW6V4LADEg4OHS1vRi03vvAkz/ J9J2XRvQA4jJlV4izxPgkSumYwNdrQfm839hRq1zGrZc4MWnabx9MGWutEFPuYxNcXn8 d1D0dX01odG7rkd57XJOlEQfMHjP9gsobu6KS/wNnwrSjP6ZrWmBKzV9IneKaNAXiROu 9QDCQRbnF3qse43ZguOZD8FTNPg0EZQx6kDIX2HE/FSpMCUfsJo+mwIS3E1OdFpPkPuM bQloFYfBNQjTCYcRtMttCukheI9BlzxMboEEKRcoQ7GnOdU/eOZMgE8RW/VhZ79Nz2Ct oahg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680205662; 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=0yzRJTK+hC1zirNLsI9dbg/pchZpukz5xu7JXlA0l3k=; b=xYcV03I3jwa2dQk2B9LJxrUAEDy7IqqQZRIBOVA6GyJ+wPdpf/16W6sP35LGdBUf3h 2sduQPfUEwP8TMHxPxeFxlEyInGbjhYLCaoQfrCvJ8fbav5K81YR6agjwv64cGwvfID9 bln7Ar9jPBJt+YOfCdh2aRqbAM9tS+1IRIlsnM68HJeofkp5bBq+fsLbVo04Q4ihsbwS RjsZVg2eZl4UfEkus5vQwYh4B2/01zx9QLEfXO+5+hubKlDH/tg9yXRvF3O/y+1IHtzj 2+gKfy6J2GjbyTzzRsKKmyRmqNYUSJJOphk5VdgU+XMwB1/UD/tRMCU0Xtnybj+pUMsR Ajzw== X-Gm-Message-State: AAQBX9dH0KCkPa9cZG5NW2fA8EUoEjRQtPeQyqOIIxubg6NyRuJaO+kY MCaSmkImU0tmbkeUZL+S/ekfuA== X-Received: by 2002:a2e:b8d5:0:b0:2a6:1dbf:5d3e with SMTP id s21-20020a2eb8d5000000b002a61dbf5d3emr581864ljp.0.1680205662730; Thu, 30 Mar 2023 12:47:42 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id i19-20020a2e8093000000b0029f3e2efbb9sm46674ljg.90.2023.03.30.12.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:47:42 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH 2/6] serial: msm-geni: remove redundant includes Date: Thu, 30 Mar 2023 22:47:32 +0300 Message-Id: <20230330194736.2400593-3-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> References: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 30 Mar 2023 21:50:39 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean For whatever reason, likely a driver stub was copied from another driver, the driver contains a bunch of unnecessary and confusing includes like watchdog.h etc., the change reduces the list. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Konrad Dybcio --- drivers/serial/serial_msm_geni.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index 3943ca43e49e..df61ae04df0a 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -11,15 +11,9 @@ #include #include #include -#include #include -#include -#include #include -#include #include -#include -#include #define UART_OVERSAMPLING 32 #define STALE_TIMEOUT 160 From patchwork Thu Mar 30 19:47:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 668614 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp115764wrt; Thu, 30 Mar 2023 12:51:58 -0700 (PDT) X-Google-Smtp-Source: AKy350Y/TnUCtTCRkjloZnR5QoO5ZbKmk9Yl5LgLdCAVoNIHXdcwd7NRosEFx6fExb12+GgZbEoq X-Received: by 2002:a17:90a:193:b0:23b:89df:4cf4 with SMTP id 19-20020a17090a019300b0023b89df4cf4mr26773159pjc.42.1680205918547; Thu, 30 Mar 2023 12:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680205918; cv=none; d=google.com; s=arc-20160816; b=OMlN1/m6IHvAAwydo6xN69HdO9a5iYV7gxh8eNQuQA3AjwXJX2S2Oy63n9+FMDTnn2 wsn8vaYpY945EjAsi1U+LiatnKmlizhTF9u9HrV4LlYaw3svYEl/jhJXjnY0NMDDscAo GArMMkb7VGEaAMC2EKFW0Vpd91eXpee43HcIRVsEJ0d39ID4S1vSo9tdIlrJFsjDlgz8 WThgWPC7UhOp+G8Ee3c46OmVni2pltWJfjUj0ZurGz0lGBQpylpkKg53JNdV19/Z14RF 0g0gneBX3KjeFNoamuK9dVU1ZLoA8sO2Rtc36To3ii6HrmFqZB1Lui1MSbclhTcoAyac hqaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PuurH8vF6+a47Q4Rv9X42jn7qcMFtqrCUke6q+YLwiI=; b=KIPIOnK0cZ+eRR7KJBIyJKtUhwLNo6pAUOd1s9VrOKtp1xldi1BP33OK9bO3n/wseO Kn5nRYc7FL+J+NJXkyzE3hFeCf2lHQaTYIM3Fm+POmJB2qvlpsjlDj4amxWtdKmLU6Jk I4r4V9sK0k43XUct/z+DzAIsZmo4MbO3otuTBA/TvVrrgsE3pTjXu7Kf81oN5v/4gbfl SLRUKQLrGxpWl97And6FfNGe0LS7Q1g6E9eEaT77cZNWVBvyFMrG9OygTl5OIieaTw1y VOcqpdyYwuyuBHGhGztsydRFgzImC/1M5MnAqOTIDj+krSidZkkvdlHK4cf6ZIEUZWJP BiNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q4kQ7HNG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id d23-20020a631d17000000b0050239e95d34si425499pgd.260.2023.03.30.12.51.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q4kQ7HNG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0CA2986140; Thu, 30 Mar 2023 21:51:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="q4kQ7HNG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E67A685F30; Thu, 30 Mar 2023 21:47:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (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 E35B585714 for ; Thu, 30 Mar 2023 21:47:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vladimir.zapolskiy@linaro.org Received: by mail-lj1-x22c.google.com with SMTP id by14so1630797ljb.12 for ; Thu, 30 Mar 2023 12:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680205664; x=1682797664; 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=PuurH8vF6+a47Q4Rv9X42jn7qcMFtqrCUke6q+YLwiI=; b=q4kQ7HNGghWWJC4FI2hqYh0nJekliqQ9S+NvGteLbAybrAkAn4dml0oA3BdedY/LZK dOKaOl/i/bhaa/RhU3xWvphg3PmP32PZlUsHiw9x8t7yFrOwxuBsGdDMvBv0kXx38CC2 rmPrHzUGWt/Wijl18XQRakwmMHpGov0wNx86MxZ10FzO2RBcaXLMjAo+JCMTASG59/Ck q5cBk/gguOxpmF2xy900FHFDP0ZCXqzfhv7RjDYp0ZJoQz+7N6ASVQ1n87KtnK7jtRSt bD2xBglyzF4ut+7Dpb5+LniZnDwc0EKrR0FKXL0XxDs/IceeyBbcwEGN2jPLgiTur96S 5Ktg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680205664; x=1682797664; 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=PuurH8vF6+a47Q4Rv9X42jn7qcMFtqrCUke6q+YLwiI=; b=o+xAv3FrzSgDJUsqvxo4cNA/FywStJ4/29pbwSrlhLxy7Lgl6TRPZsrhuNhJADb+jS 7RvJnP7qEjU/c9Zep20EuSbjscUFIHeVI6KKFYbSAzMAIIPC+eLux9aA11anKZ8zVotg x+IDnnTe1amMbNixxtWV7pcJzpqwLYCF4U5dGa/kW7aK+a9kjIYid2fepgSmK/XG99NA 6vb6BvvXgNyTIdjQznBsUlIsN01TDyQFVsNFa6uVbXivliZKIKHbS0HpG67JOypWkKoO KK2fE1ahk7Y9o0gn0SuNQAXPlQ1wCUc7W/iRcISCO+5xo7bDcT8Tf1cj3mgTP7pmr/KT pv3g== X-Gm-Message-State: AAQBX9cY5uEmOltGPRz5RlHSXmhw8k5bspjr9dXmdAf7XlwDbChj12ob zmU0vuktE2OE7r/CQyMltKYUUA== X-Received: by 2002:a2e:bc05:0:b0:29b:55bc:2bb3 with SMTP id b5-20020a2ebc05000000b0029b55bc2bb3mr8455615ljf.3.1680205664224; Thu, 30 Mar 2023 12:47:44 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id i19-20020a2e8093000000b0029f3e2efbb9sm46674ljg.90.2023.03.30.12.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:47:43 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH 3/6] serial: msm-geni: remove invalid se-clk clock name Date: Thu, 30 Mar 2023 22:47:33 +0300 Message-Id: <20230330194736.2400593-4-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> References: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 30 Mar 2023 21:50:39 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean There is only one clock supplier to the serial IP, thus getting it by name is not needed, also note that "clock-names" property is not listed under doc/device-tree-bindings/serial/msm-geni-serial.txt, and finally "se-clk" clock name is invalid, if added, it shall get "se" value like it's already described in Linux device tree documentation. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Konrad Dybcio --- drivers/serial/serial_msm_geni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index df61ae04df0a..1b12fdfbdafc 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -183,7 +183,7 @@ static int geni_serial_set_clock_rate(struct udevice *dev, u64 rate) struct clk *clk; int ret; - clk = devm_clk_get(dev, "se-clk"); + clk = devm_clk_get(dev, NULL); if (!clk) return -EINVAL; From patchwork Thu Mar 30 19:47:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 668616 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp116022wrt; Thu, 30 Mar 2023 12:52:40 -0700 (PDT) X-Google-Smtp-Source: AK7set+NBxFoVw4zpizL8JaiNm8RaGcjBrIKEZ3KvRK8eWYW3cRmDtyvJJlvXAJ9VdoWwnUaTt+V X-Received: by 2002:a05:6a20:4d97:b0:bc:80bd:462d with SMTP id gj23-20020a056a204d9700b000bc80bd462dmr22995621pzb.46.1680205959791; Thu, 30 Mar 2023 12:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680205959; cv=none; d=google.com; s=arc-20160816; b=b8RsjFdq5X/ePucHnkAVbjXQzvZl1Q2Jby1pjfnxxusPE90XcpqhlX9+6fbZTHEYAn pBk4LiPm73W1RAdTx8wTsDR3BN64m3KlOKRI3swx77qWZTrW0KG+NQL/SKr3it0phTwh BV3tmZkNKZ44GIVsyDurQntP0VGRWOQ/GLCxUffuxhm/2F80aBvn4pDeIBuxbJmCHtRT aknViPyvGG59JGgoWc/nM1QAZFVRpb5Aiq7S+ariDhfyHT9o0PZ58a6HQZ6BNGZMbjNV BccZhA64+uNoUHEdvQaWJwv78UbnKslxAJwh/gIyxMCYONWQb+N+h7BOzOZkDvx7O6vf HKGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hOGcOdvTOsTiUC/izO9Mb9GEbqPAEwTkctGdmrUqj2Y=; b=gekIhqGCfXVq7pug3pmLaIs7GZ6bJrY5Y0i42e04ShpwNn2e3j2PUcsHn9IeVvG+1X wkI8QKpp9TwAliXuBg72VATcDzF//Ka+Jc3oxNhvTrmw95wBnT4sNowRuuYW/Ett6rVR cOO+wv845Pe2L34/TuK4alTiOp+KjS/1n5cpttrEHeDbxMg8SFCjl3y44radCquhSKFD R1qZTOnf0eK2aroVBfW977uBSQ+19TY3MML0mERHrISixNjf+oDzi8zK2QAUjxvN3oSm O0JOv80pHrmX2M2dFyKF4kEbsOyyYJP3FkOcl++ME6I1KfHTGWCajFse4PndAPdPiQHm cS5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aGxOapN6; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id b15-20020a63e70f000000b0050beb3fe626si451302pgi.13.2023.03.30.12.52.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:52:39 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aGxOapN6; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 76160861A4; Thu, 30 Mar 2023 21:52:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="aGxOapN6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AA12B85F13; Thu, 30 Mar 2023 21:47:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (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 6CAE085F06 for ; Thu, 30 Mar 2023 21:47:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vladimir.zapolskiy@linaro.org Received: by mail-lj1-x236.google.com with SMTP id bx10so2482504ljb.8 for ; Thu, 30 Mar 2023 12:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680205665; x=1682797665; 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=hOGcOdvTOsTiUC/izO9Mb9GEbqPAEwTkctGdmrUqj2Y=; b=aGxOapN6IWbEW1h3xG7m5UCvVppAhQt9UKXVjOT0fWswFF6Y7esl3ExVGPfOXtYFQD JH61b7ezQbEyGoU9Fg73vUSA6h2KQAYU+y0yHFJKEv1kLEU2hmkTsGC8korZwwSjXEFj VWNJ31Ux2QMC2Wv9FS0ij57BBND/MjdUwNa6rSTyFJMVTBdhOjX/CMN4uxG9Fifihncz vaQnZIkCV0g7i/3yco5uw37CWWvkeDt9W3Deb3da0lawLO8D903WZIuE+gSeAojLvEMi IflMwwzvdgJVaAHkmkx5nBw7mqmVnQx4OE4jELSV7UEPgMimXg8tALxLYso6cUaRqhxh CVUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680205665; x=1682797665; 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=hOGcOdvTOsTiUC/izO9Mb9GEbqPAEwTkctGdmrUqj2Y=; b=JA2Svilj9Ma1okHmiKSoidgFpluzcEBIjvA1U+BlIiBnXTfvgrgV5CjbkQpscXSWQd I2Kdsa+6sV0cE/fgY3xPYquTRjW2SCTIJYykcqvxz86FHvlriJBs2ipBPgxduLqgzz55 DP+8O2NiTsOTjo5YzQcrdLJg4zOcvEXF8uWhWEQzIw8yDK4QrtBNhQLU9wuL2RqQzFOe IiZZOUrt0a/JOXa4qt5Lwf+HF5n/Zh1WrXogAslpZ+Rv1ag5EuzbYq2onXNohfvjEeeT SX9EVfobd39onrbM5EOVcezoBKP9HWty7+OOFbaqww6Y4qEAz6oZ5uihT1qyrERh0NCi QEQw== X-Gm-Message-State: AAQBX9d7hxhQjj2Al0k/2pYrcTqHb7Cw9pEZBK7KbDKkuTQCUDyUoM36 oM8d0ixfA9qhtAnGMx5MMVX6fA== X-Received: by 2002:a2e:bc05:0:b0:29b:55bc:2bb3 with SMTP id b5-20020a2ebc05000000b0029b55bc2bb3mr8455628ljf.3.1680205665645; Thu, 30 Mar 2023 12:47:45 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id i19-20020a2e8093000000b0029f3e2efbb9sm46674ljg.90.2023.03.30.12.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:47:44 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH 4/6] serial: msm-geni: fix code indentation Date: Thu, 30 Mar 2023 22:47:34 +0300 Message-Id: <20230330194736.2400593-5-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> References: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 30 Mar 2023 21:50:39 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean This a cosmetic change, which corrects code indentation in a few places. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Konrad Dybcio --- drivers/serial/serial_msm_geni.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index 1b12fdfbdafc..c9813f06ace7 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -130,8 +130,8 @@ struct msm_serial_data { }; unsigned long root_freq[] = {7372800, 14745600, 19200000, 29491200, - 32000000, 48000000, 64000000, 80000000, - 96000000, 100000000}; + 32000000, 48000000, 64000000, 80000000, + 96000000, 100000000}; /** * get_clk_cfg() - Get clock rate to apply on clock supplier. @@ -160,8 +160,7 @@ static int get_clk_cfg(unsigned long clk_freq) * * Return: frequency, supported by clock supplier, multiple of clk_freq. */ -static int get_clk_div_rate(u32 baud, - u64 sampling_rate, u32 *clk_div) +static int get_clk_div_rate(u32 baud, u64 sampling_rate, u32 *clk_div) { unsigned long ser_clk; unsigned long desired_clk; @@ -228,7 +227,7 @@ static inline u32 geni_se_get_tx_fifo_width(long base) } static inline void geni_serial_baud(phys_addr_t base_address, u32 clk_div, - int baud) + int baud) { u32 s_clk_cfg = 0; @@ -268,7 +267,7 @@ int msm_serial_setbrg(struct udevice *dev, int baud) * reached. */ static bool qcom_geni_serial_poll_bit(const struct udevice *dev, int offset, - int field, bool set) + int field, bool set) { u32 reg; struct msm_serial_data *priv = dev_get_priv(dev); From patchwork Thu Mar 30 19:47:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 668615 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp115885wrt; Thu, 30 Mar 2023 12:52:18 -0700 (PDT) X-Google-Smtp-Source: AKy350bWT2r1yDMl+AINMTPJdOS5x0gP7pQbFh1mZp4zjj4YVrhIu/k91411JnvXeRRQEXwqZr6H X-Received: by 2002:a17:902:f243:b0:19c:dedd:2ace with SMTP id j3-20020a170902f24300b0019cdedd2acemr19934381plc.18.1680205937928; Thu, 30 Mar 2023 12:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680205937; cv=none; d=google.com; s=arc-20160816; b=oW4UxFbD+CCcLmYKFeGjCn4xmC/fiiUSmIMJKmApyfkxcL1y8o86kCp/F5bQLn9Bnx XUm3qasX3vs/E0tUQgvIhFxgdwpamtfpk5MHE7pA5GeUDLbgAaqBqSnv2wzy1UgA2BJ8 8DP8wMBB41X1LkXe2JWAcEmU2kJOGmk5BJuRI1bjkaBd6LogNr+iSTKrgM74AZbOxZaN j5cPgqRCabgUH8wg3iSqemg/NYE/8oHCVpvs2rUg41P/3AiuodvgXBdEOV3PL5rVQRUL Z7P95r50lL42w9uF0CN6j8sckOJZBqWDCtG9c2fp1CWnjKby6lrJiG/V6VJtxFPJvzrd Wt2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mrG/avnO6Jw8vyPADZB+w9EQHRUILPfCUei653/oKCI=; b=nbOkMtTTze7eYvaHUoD2DbbUmJdhPzOYo0KlJ+amfVMBYv8iiwOlwaRnEMp+BTKs1u izG+6VFoG63aoBPUsku8h36V6/BVW6Z7fJDRiAjb24nDNuXBpZq6RuqV0NoWdV6oMS2Y D+R9TSzPs+EqTtcx5+ddn8bTgCdIQDtxpjU34SLB6Gtlpypb4RyrvASONKu5F7yJPtkP j5z0QjaiR5voFcUfQbt+sdrjb2ayVNq3ejuq0hbLWpctAuOV5fMQQksKSPSCo6EpgTQU /S+kIL22Gn4RxDIGv3mTRKy1r+QTbVxtqEW6QSp3bUkwFY+jdkSapq8fW6b4rmGzoB5t 8zOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PBJ34MMT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id n10-20020a170902d0ca00b001a1a8d97914si236836pln.437.2023.03.30.12.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:52:17 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PBJ34MMT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1B8318619F; Thu, 30 Mar 2023 21:51:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PBJ34MMT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 09D7885F30; Thu, 30 Mar 2023 21:47:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (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 6471585EF3 for ; Thu, 30 Mar 2023 21:47:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vladimir.zapolskiy@linaro.org Received: by mail-lf1-x12d.google.com with SMTP id c9so15546954lfb.1 for ; Thu, 30 Mar 2023 12:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680205667; 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=mrG/avnO6Jw8vyPADZB+w9EQHRUILPfCUei653/oKCI=; b=PBJ34MMTQKBqvAgxwl1ROM0xuvsatrdc5Bmxr6UaCXui94FD3dioRikUO8aQmN22Jz 8fkAVjJZmDuFn4jRb2r4cBVJBfevQ5+VZ893xmr2/f6RkAZGwpPtFCBkjWQLuPbjB4cW xcTa8dNfYitFrK/ogDibGmg5nbYNoun7IyXSTbkXSiciW7T/SLZYZCr5vpBPmkt73q4J +qBgkCMBcer/5MhpVxdQR5Y7dWQ3+/o8ZuziSS4zuoZaICQo5fojDrPiKTEhOwtZqt1i Omvp3UnGT1TDRoaVZhRe0LNhYm1PruY/AR02rDH7QbrXu4rmFvACqOryRQqD0IeawBMr 5QOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680205667; 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=mrG/avnO6Jw8vyPADZB+w9EQHRUILPfCUei653/oKCI=; b=5a682RP4pMajs9xl4YNqp2MyV4BMXNTXezMwt0rVy5bePycZNFBvDLuJPAJ02b+Zc6 Kthv65AzCDq+TrslFBPkOKVzQRzoBC/5OYMl+oLdhvoSNoKrteDcaBp+4Htlx9MtKA9d UD6bjGgsrAm7BLq926qQy3uvfqmfrUvF+fk4vJiB38tOZG90vlmFYh/kJZiXCBqhE7Pw 8ABR217sYg8LimJzhutOJ3nF6wwEVnzCc0UNc4qHn1kfhxmroJc1XSIrgtu52XdBvd2W RAQvrdl5S71KJFySU3tTvQbv3G2evJrTslYdkUBzxriTrLMbuJ0Je8m3fxrzrGivtRzk gzQA== X-Gm-Message-State: AAQBX9fMeCJgk6Dh04Iyyi788h6oeToQeLsgivxIzXK/xxE5zf/uxf0L NnZqQgfYeGGQT5d0RS4QBU0rTE9dE6p7zjIdJMHWNg== X-Received: by 2002:ac2:5684:0:b0:4e9:c792:c950 with SMTP id 4-20020ac25684000000b004e9c792c950mr833912lfr.1.1680205667537; Thu, 30 Mar 2023 12:47:47 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id i19-20020a2e8093000000b0029f3e2efbb9sm46674ljg.90.2023.03.30.12.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:47:46 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH 5/6] serial: msm-geni: fix a compile time warning from msm_serial_setbrg() Date: Thu, 30 Mar 2023 22:47:35 +0300 Message-Id: <20230330194736.2400593-6-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> References: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 30 Mar 2023 21:50:39 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean A compiler warns about a missing function prototype, which is valid and fixed by converting the function into static one, also fix interleaved local variable declarations and assignments. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Konrad Dybcio --- drivers/serial/serial_msm_geni.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index c9813f06ace7..03fc704182d3 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -238,13 +238,13 @@ static inline void geni_serial_baud(phys_addr_t base_address, u32 clk_div, writel(s_clk_cfg, base_address + GENI_SER_S_CLK_CFG); } -int msm_serial_setbrg(struct udevice *dev, int baud) +static int msm_serial_setbrg(struct udevice *dev, int baud) { struct msm_serial_data *priv = dev_get_priv(dev); + u64 clk_rate; + u32 clk_div; priv->baud = baud; - u32 clk_div; - u64 clk_rate; clk_rate = get_clk_div_rate(baud, UART_OVERSAMPLING, &clk_div); geni_serial_set_clock_rate(dev, clk_rate); From patchwork Thu Mar 30 19:47:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 668618 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp116569wrt; Thu, 30 Mar 2023 12:54:17 -0700 (PDT) X-Google-Smtp-Source: AKy350ZWoZ45WVq0QxOgGw/srR+1oq02GsFNNsS8fnNznx1Opb/Iut6hEphU1s4m55ihD9HacsPK X-Received: by 2002:a17:902:d04b:b0:1a1:bd50:a9e with SMTP id l11-20020a170902d04b00b001a1bd500a9emr18407963pll.47.1680206056987; Thu, 30 Mar 2023 12:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680206056; cv=none; d=google.com; s=arc-20160816; b=O87X04kC2rZ43EjTu+g1qJH8i2BR76ZE4qk9xJTaSIyfRdVg5mGj4eigWJTzWwGfA3 BojrCXRHQYN5rEArCIwHyumnTXfqSHQLNaNqKcgYu/pSeVxkBKdq7Zv6PAargzP4w3LZ gwmSbFX41xpwJhJqg/C5deJlIrAe0OQXy34Jv3FZb9oo4nQjZqfJ40+r5lGTEqJf1093 YwPbV9NG4Q6JtZ3erj0gc8Ra9HN//kXfNgUdHAlcEKRvpVctl2CM3SMvWzyxRqIKhbKt uBbv9G8jN8FjBViivQ02ctoXKv8STOs8u8AfszxpAifCbZWIPzt3Rb5sN0v0UqePwugM DnPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YcH8fPhA6R24B76yL7sF40/TUvb/Kw7zEvmOHZDG9Ec=; b=iYndXVoXp7CunEr+rYVmrv1RI+FNfzN8BBt5stw0DnzStGUSpMXAzLR/rGeRmL3jGh KEmONOSKR/BE0uWh3RNXS4BxVdltejZVNraxwr2BNecUx6oGZHpD9eFul51R0Rie8pQj zcqC3ApLVzWSZe7ApxMW8oxLjdLDuIb9J9BWA5i6rmP0KYrklI2thDp5SQkUJ0zJlzhK wwDp5ZKDpm5IbfrxtXhLcM0VkBYY5HJQRQZO+BDfT1bsYYGJYheC6LtOt/Icv5F8vwIA Tc0ba532KBONmIjJNGaiB0W6XXdMPUJRbPSmHTMEfsIKZ7VoOUclS0UfqNOGnzQkWlNV pDZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="w5AvDkQ/"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id n5-20020a170902e54500b001a1c73d52ffsi335404plf.28.2023.03.30.12.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:54:16 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="w5AvDkQ/"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B4CF861A0; Thu, 30 Mar 2023 21:52:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="w5AvDkQ/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6060485E44; Thu, 30 Mar 2023 21:48:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (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 C814685F2D for ; Thu, 30 Mar 2023 21:47:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vladimir.zapolskiy@linaro.org Received: by mail-lj1-x22a.google.com with SMTP id e9so5539838ljq.4 for ; Thu, 30 Mar 2023 12:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680205669; 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=YcH8fPhA6R24B76yL7sF40/TUvb/Kw7zEvmOHZDG9Ec=; b=w5AvDkQ/tnUza7KIye96/fdUkSkdq42LdvGFsxle7MoZRq9rhUV/w5aceks3EeHu9p fhCq7K+PSCzXZKf5HuwgxiieMZqRfA33uNEHzEsOACrO9V0S5FPndPCeODBef5wMw0Vb SItElGgAGWQXIZKwFjh1I5O3i3YmQsnp+Kp/olA2Wd0Xipa8NWVzUB8zpvwvEEMVd/jx sgZ8avApLekhv9BUHYdOAwJpaF2XLDGyrP3hlxKltorO8Ll6khK2tAg7NykgklKuzi4L IRoQTMCWvmFugWQRh+X+OruLFByKTEVduaxc2vROglCORyZl7MaWKiW6VEPnIQqXHjCd Iexw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680205669; 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=YcH8fPhA6R24B76yL7sF40/TUvb/Kw7zEvmOHZDG9Ec=; b=oh6cRJ9WVxkRVDx8A7+KOi8v7vk3YO6RCCRSxX1sxRLt75JRJFfzwiZT5yOMlhQo+O ilzdgglgR2ByRRC5uO1pPw+FonIv1Npr/HzxZhc2/5PZHlqN8+qvN6XUOMlCZtm2Zpgg oE/sHE1TbZ0SScxJfnVLgp4lVlBneTMtlMvX/2MGbmBsvU4knLyEvgjuuxe/k2fNrP4v oBmoBxr+h1kCiPluLE+ZkmviXPGSdY7j/AgF9z0AqHnjs6mKrvB2oXSEd/Ufb9I57zbE lbQqVtbGd1rtq3ivEptoXHjRysYcTYZsOCRwRlv2BziXsV8qgJPxfAPUCS5cxnDQR3/f MWbw== X-Gm-Message-State: AAQBX9cFO1F8DgdvdAUAkw0lN7rqVtoPahysqHcZ6UnRK6sxSSdJ9tmx QneGk4eySfF2mvYOQX+kIfZkgQ== X-Received: by 2002:a2e:bd10:0:b0:293:2e06:8567 with SMTP id n16-20020a2ebd10000000b002932e068567mr1100964ljq.2.1680205668854; Thu, 30 Mar 2023 12:47:48 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id i19-20020a2e8093000000b0029f3e2efbb9sm46674ljg.90.2023.03.30.12.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 12:47:48 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH 6/6] serial: msm-geni: correct oversampling value based on QUP hardware revision Date: Thu, 30 Mar 2023 22:47:36 +0300 Message-Id: <20230330194736.2400593-7-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> References: <20230330194736.2400593-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 30 Mar 2023 21:50:39 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean Starting from QUP v2.5 the value of oversampling is changed from 32 to 16, keeping the old value on newer platforms results on wrong set UART IP clock divider, thus the asked baudrate does not correspond to the actually set with all the consequencies for a user. The change links the driver to a new Qualcomm GENI SE QUP driver to get its hardware version and update the oversampling value. Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched, since a wanted baudrate can be controlled by setting a modified CONFIG_DEBUG_UART_CLOCK build time variable. Signed-off-by: Vladimir Zapolskiy --- drivers/serial/serial_msm_geni.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index 03fc704182d3..cdca7e83daa6 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #define UART_OVERSAMPLING 32 @@ -110,6 +111,10 @@ #define TX_FIFO_DEPTH_MSK (GENMASK(21, 16)) #define TX_FIFO_DEPTH_SHFT 16 +/* GENI SE QUP Registers */ +#define QUP_HW_VER_REG 0x4 +#define QUP_SE_VERSION_2_5 0x20050000 + /* * Predefined packing configuration of the serial engine (CFG0, CFG1 regs) * for uart mode. @@ -127,6 +132,7 @@ DECLARE_GLOBAL_DATA_PTR; struct msm_serial_data { phys_addr_t base; u32 baud; + u32 oversampling; }; unsigned long root_freq[] = {7372800, 14745600, 19200000, 29491200, @@ -246,7 +252,7 @@ static int msm_serial_setbrg(struct udevice *dev, int baud) priv->baud = baud; - clk_rate = get_clk_div_rate(baud, UART_OVERSAMPLING, &clk_div); + clk_rate = get_clk_div_rate(baud, priv->oversampling, &clk_div); geni_serial_set_clock_rate(dev, clk_rate); geni_serial_baud(priv->base, clk_div, baud); @@ -480,6 +486,27 @@ static const struct dm_serial_ops msm_serial_ops = { .setbrg = msm_serial_setbrg, }; +static inline void geni_get_oversampling(struct udevice *dev) +{ + struct msm_serial_data *priv = dev_get_priv(dev); + struct udevice *parent_dev = dev_get_parent(dev); + u32 geni_se_version; + int ret; + + priv->oversampling = UART_OVERSAMPLING; + + /* + * It could happen that GENI SE QUP driver is disabled or GENI UART + * device tree node is a direct child of SoC device tree node. + */ + if (device_get_uclass_id(parent_dev) != UCLASS_MISC) + return; + + ret = misc_read(parent_dev, QUP_HW_VER_REG, &geni_se_version, 4); + if (!ret && geni_se_version >= QUP_SE_VERSION_2_5) + priv->oversampling /= 2; +} + static inline void geni_serial_init(struct udevice *dev) { struct msm_serial_data *priv = dev_get_priv(dev); @@ -523,6 +550,8 @@ static int msm_serial_probe(struct udevice *dev) { struct msm_serial_data *priv = dev_get_priv(dev); + geni_get_oversampling(dev); + /* No need to reinitialize the UART after relocation */ if (gd->flags & GD_FLG_RELOC) return 0; @@ -557,6 +586,7 @@ U_BOOT_DRIVER(serial_msm_geni) = { .priv_auto = sizeof(struct msm_serial_data), .probe = msm_serial_probe, .ops = &msm_serial_ops, + .flags = DM_FLAG_PRE_RELOC, }; #ifdef CONFIG_DEBUG_UART_MSM_GENI