From patchwork Wed Apr 12 14:29:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 1768175 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=vp12xO64; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxQ9R1Mdkz1yXv for ; Thu, 13 Apr 2023 00:30:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 694F885F94; Wed, 12 Apr 2023 16:30:22 +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="vp12xO64"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C4DCD85F85; Wed, 12 Apr 2023 16:30:14 +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-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (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 CD18285F70 for ; Wed, 12 Apr 2023 16:30:11 +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-x133.google.com with SMTP id 2adb3069b0e04-4ec81439f04so197544e87.0 for ; Wed, 12 Apr 2023 07:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309811; x=1683901811; 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=f5albaxkC9QwjUU9wkRAz8fu89F0BGgw9MKtk/ySzXY=; b=vp12xO64fQswKMuEZIucTNbKlQgkvzPAOI+m8fO2dSKH8/t+SWqTgyqDnZVlo2dfOO dsiOxVHNMFj1eKOvsnDLDXwgzd1PrfcTAkXpi2S8GcU9OEvJwSmLJPASkdi0ZSBJGXgB JLvdYdEdgk+OuthLvPwq2ZOap1TfdzYZLaYwQjRQI6S5b97AhAIguvi6Bwq6vs32dUMS l+RjLkK3WkbndgKht+x0W7dSV0IRB6dzbumBTGl6gaq3K+JWJCvTLFUcKfuzQ9nFQSUQ CacNMyvpiR11woigMHmMzwqhxdze8WOi2WHqW4IBkZc6rsXQS94HSZKhKn39vcq9yxWl dWMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681309811; x=1683901811; 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=f5albaxkC9QwjUU9wkRAz8fu89F0BGgw9MKtk/ySzXY=; b=KrCd+Bjk6WdJ4DvqvuyRzI9IUxQ82hw6JZRsZy0P6A9zfjytcj1z3IQrSgXTCo8tck XwSpIupTilFHgt9x5uMFhCAwhfE4Aep697NtrUyfj4iuMDc0EqT1JjYy9Y3XtPuN/0l/ H2DOheb0h6iHk5/qjzJzT60l+u+JrgYjijxD+gRXW5NQOadzzVHh1edfK3H9u4yWlFEm vZDpvrEGnPYn3qZstTkGyJ4cAw+Q/bwBJGTAq/5b5n4JSHkMlW4GeKK3d5kAxjK1ukyZ FzSPa/WkCvti7mt73x1qCfiLKJX8yS2Lhs9XaTPxwzoalkfrcZ1NZSqkZlGRrGQruRaR TnfQ== X-Gm-Message-State: AAQBX9dRyIEX9qruPQwSM9cQzVfnG7YXdZ631kpmLxIA6URfDe6fG+/4 NNZrBNuJwBPg0u2WyYA8lC/B/w== X-Google-Smtp-Source: AKy350bmTo8P/XmNXLJXktoSOIhMBdnKOv8k3Nt0JjlKVEZS/qe8OBKKAIzT/oLuwKAI6+Wtilhnzw== X-Received: by 2002:a2e:a815:0:b0:2a7:9987:571d with SMTP id l21-20020a2ea815000000b002a79987571dmr710762ljq.0.1681309811212; Wed, 12 Apr 2023 07:30:11 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:10 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 1/9] misc: add Qualcomm GENI SE QUP device driver Date: Wed, 12 Apr 2023 17:29:58 +0300 Message-Id: <20230412143006.80946-2-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 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 | 7 +++++++ drivers/misc/Makefile | 1 + drivers/misc/qcom-geni-se.c | 41 +++++++++++++++++++++++++++++++++++++ 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 4e1ae03e9fd4..04460f1acb25 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -511,6 +511,13 @@ 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" + depends on ARCH_SNAPDRAGON + 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..b1443ad66d26 --- /dev/null +++ b/drivers/misc/qcom-geni-se.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm Generic Interface (GENI) Serial Engine (SE) Wrapper + * + * Copyright (C) 2023 Linaro Ltd. + */ + +#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, + .ops = &geni_se_qup_ops, + .flags = DM_FLAG_PRE_RELOC, +}; From patchwork Wed Apr 12 14:29:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 1768177 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=vs5k3KhP; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxQ9t1rv5z1yXv for ; Thu, 13 Apr 2023 00:30:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8E1D885FC2; Wed, 12 Apr 2023 16:30:30 +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="vs5k3KhP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F2D5285F88; Wed, 12 Apr 2023 16:30:16 +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-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (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 5BD3285F77 for ; Wed, 12 Apr 2023 16:30:13 +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-x130.google.com with SMTP id 2adb3069b0e04-4ec83ae6138so166642e87.0 for ; Wed, 12 Apr 2023 07:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309812; x=1683901812; 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=LlALwL79O6+cCuRN+rzhCrrYlDj8MP0mBmjzSXa2lhQ=; b=vs5k3KhPbRn/YQA30dUAJYVfOufyeZ5IlmwmYwjMEjKXNR1knlEtrpj9oy21AaQ3Qa bvL0IIcSbCBvflpuKaagNJKw3YOrBqmC0SehvOhZ6R8s8yBhsN+e6X/kspOZis3oCfQR zoTkic+zy8wVL5RvWHQXHLv7oMBilRYXsH6zXQxGxN+hrd9v3Bvn5cnxzHuyuMw1xX1+ J0T789P2gCOd6+Nuc3bHTySkQWvRDMX+M+BndN5BMFcZOnl6J6F9aZYn+ds7ewFgLc+U L0UKyjRY2V3s3E8r5n9+jxrteUyAgurSAnZ1BheqgxiWyXbPrOPRECe3sjkLIJriGps9 I4EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681309812; x=1683901812; 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=LlALwL79O6+cCuRN+rzhCrrYlDj8MP0mBmjzSXa2lhQ=; b=JXSKODNyyCa671Lh8cB6US7X9XdbDn9z0BBKqdRCj3hSH+vS/uVgx7OulWsQnvB0oR crGcjoZQZeM+DhOmHGfDQkS7EY3WhN93dh15kA0KxA+jtXWOwobwTQQZ70WaAmLrZmNL cfeDbuBJpoAy2ul9PdLq1esCzEI01liYGLQZ65WPsCvctTiZ7Kitgela6zxvcH91fbOR 2B8EiyFbp5bRI6QJsFbFdWz8lxHmsxrC06wOcwep+I3p+73vY0iLiHq+UExBvP9p9pLh JGN0tt0nZ1SbFWJN+YG+8emusAuW461nZwzwZUurfca/flaBf5RGSEzF6MGVWPx/M0Qi gRiQ== X-Gm-Message-State: AAQBX9dd0aXtevqt2VZTpS13wUDVbqhyKj0k7g151BTOyitNHnZ8T034 p7FTN0bwgTEgjBa3BNNZYwbA176nffTWDLpLQjWDTA== X-Google-Smtp-Source: AKy350Z+ZF/tqbpgceYlEIxSc0q3XufGK9EKveVv3u5qZljsQI4Yjv6TbqPI0Hpu5VUqNzF2IJaldg== X-Received: by 2002:a05:651c:514:b0:295:a08c:12a1 with SMTP id o20-20020a05651c051400b00295a08c12a1mr773687ljp.0.1681309812640; Wed, 12 Apr 2023 07:30:12 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:11 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 2/9] serial: msm-geni: remove redundant includes Date: Wed, 12 Apr 2023 17:29:59 +0300 Message-Id: <20230412143006.80946-3-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 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 Wed Apr 12 14:30:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 1768176 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=NyuoNZ6i; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxQ9g0pVBz1yXv for ; Thu, 13 Apr 2023 00:30:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CC97C85F7A; Wed, 12 Apr 2023 16:30:27 +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="NyuoNZ6i"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D4A1085F92; Wed, 12 Apr 2023 16:30:17 +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-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (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 0328885F46 for ; Wed, 12 Apr 2023 16:30:14 +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-x133.google.com with SMTP id 2adb3069b0e04-4ec81439f04so197546e87.0 for ; Wed, 12 Apr 2023 07:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309813; x=1683901813; 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=oXYQyyuR7oVDY7D5Ghpn4whpNeQyOHW+4Hjesqp5URA=; b=NyuoNZ6i2wUZnHHXbclUR8nND9iX8RIk8yv+v93DuZZq1YBAItxIliuIm+8iNB6v7Q zTKNBBzTLXXz9fkkaCQShGjLUZluAK5n64xMPS8ZmYUz0zBOv1Bb6KfdsK0c1umX7Unv 528k4B2KzrEFSTvu6RkIGL6P86gK/rHEV2ClMqDTeciGNJ+D2XNqu1G50VkyqoD2rIim ZFTm6/rvFFJY6AzLp+zDCuwWnpqUJTJEHSKAB/chD+SQz7lHd7/FAB6Y/TZzQn4NVU2c 1/uIddP1KPitsTg9OAAnrgn52JxPzVW8p6FOWbB+OvnhevHgBPMMxRJJhVMCSAj0awLS P8Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681309813; x=1683901813; 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=oXYQyyuR7oVDY7D5Ghpn4whpNeQyOHW+4Hjesqp5URA=; b=6PD7NI8NRxgpvgdC9vP4RvZtbeETUtj4jt7g/y6+74GvKdxhjFUzXIph5+zac+J56j k2I9nlfRLayrZhyPy1KeWgvFGHtKcWA2VXNuKPV8ynwzgnOTbF2/TzEbUmGqqWzaj5u4 owE2vm9JzQEdwYcLCDvpWjpz0RpScxukY+pyO8GHFk7O9lPTMznLCtemOiS+YBkM9Nm8 9utG1odTfBKDh9kxw4Xz7XFBKtrKUL7wsHkgtRPUFZJ5LsgXqTjkvV2YJQaZpYYwa9tG qD0cUKsol5ofqacLlsTQQ/lXMgfwNSRt9rnVESeeHMv02T4HsVRhm8X+E7Mxtro3SD8z 1qrw== X-Gm-Message-State: AAQBX9cp/A++YaZzNnI1agnHFvsTAiBI7A49REPA4JX5sBQR8sfLyQJ2 YV18cQkNMjtsi/kdwWfz4fSXEwrnLohjjdBgFLSpqw== X-Google-Smtp-Source: AKy350bJJCIfgJVNEhWkZJFo+JFc67qdMs450A2D40aUBmCh+IHRTHzTzzq/gDcyegrQY2D4EUwxNg== X-Received: by 2002:a2e:b890:0:b0:2a6:1681:d82f with SMTP id r16-20020a2eb890000000b002a61681d82fmr863544ljp.1.1681309813765; Wed, 12 Apr 2023 07:30:13 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:13 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 3/9] serial: msm-geni: Always bind before relocation Date: Wed, 12 Apr 2023 17:30:00 +0300 Message-Id: <20230412143006.80946-4-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 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 From: Konrad Dybcio In preparation for supporting upstream Linux device trees on Qualcomm platforms, make this the default behavior. [vzapolskiy: extracted the driver change from a combination with dts changes] Signed-off-by: Konrad Dybcio Signed-off-by: Vladimir Zapolskiy --- drivers/serial/serial_msm_geni.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index df61ae04df0a..146b05748459 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -558,6 +558,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 From patchwork Wed Apr 12 14:30:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 1768178 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=I9vVRxxM; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxQB56KB4z1yXv for ; Thu, 13 Apr 2023 00:31:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4587785F77; Wed, 12 Apr 2023 16:30:33 +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="I9vVRxxM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 75EE885F46; Wed, 12 Apr 2023 16:30:18 +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-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (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 C34C185F70 for ; Wed, 12 Apr 2023 16:30:15 +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-x12b.google.com with SMTP id 2adb3069b0e04-4eb36162b32so279454e87.1 for ; Wed, 12 Apr 2023 07:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309815; x=1683901815; 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=RnmrsCVlgjdwBRf3bAeInT0NkMn0qIZ47/eeLwNO+as=; b=I9vVRxxMnW8U+gM2TTogYkJXrCzvLqucACKNiaNdb8efUbjRcLnZfHm2u0FFyE+znQ VVtpEXrYkjafT2ZrUEzOxJxzxiIVPGiuWsRIABa+r7e79DmY8KFWrMEnq05jWtX4kucV bSIUbWLQ98N1mQfizIpQZoSoXxFY1kS/EMTGMtWg8SUlJ1PWlZ/8HKORMhxaSOUNqcDd +79z1i9PcsjGkxMsaT0u2fdCbcJ5jwWxadZ0K1oexjXJF//rJOyb3gjrLV5RP4+RruSm eTdlJeQwnQsgevZ747HjMBSru/yMY21+E36CmQpzjSDvIejdvMKwB9DjkxgPiKfpRizs oFPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681309815; x=1683901815; 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=RnmrsCVlgjdwBRf3bAeInT0NkMn0qIZ47/eeLwNO+as=; b=M4wYbYPZCTqmduDsitnr7VEd2AACBP83B7rCxmSMLsMCO2C1BNwogvWkWkxouBgFML sC782m7mxDT8j1gB37oZjyzEi0UZELlXtFsTmz66vkLjzpvX7ybWc6iDdXjlxg27Kb7l wIaAx35Xz9MGObvNydYFDd9LIgT093V8wBv6be6gkkLucxmOp2d2GOgr05uhggOxvRMW BiWYAfu+QVzTewoNhwL8Bg8IK5hBuDI1/W8OHE5fKbfjqoh3fT0/tZwJqD8d9oJ7Gshh aPBnoEkPYZ5ZVY6/ry3qfB3OKHh7xAiznxPZthTlyuN+W1KsTNN4yGcYb9/RkuMsm47X gCBA== X-Gm-Message-State: AAQBX9cHl5GrqV8n2uOGNiajDVkof45L3ZDpNnAGeK4pf+UnbLDGdCip wo8d/cHvnrLBlMxmWqNuLxadew== X-Google-Smtp-Source: AKy350aSA5+XIcq0/0CBQmQSFP2a+POoICFq2PQhx5Ov9b+BC/wgyehAL1bWytoZB8ddWMkiIllsYA== X-Received: by 2002:a05:651c:542:b0:2a7:63d2:976 with SMTP id q2-20020a05651c054200b002a763d20976mr774609ljp.4.1681309815155; Wed, 12 Apr 2023 07:30:15 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:14 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 4/9] serial: msm-geni: remove invalid se-clk clock name Date: Wed, 12 Apr 2023 17:30:01 +0300 Message-Id: <20230412143006.80946-5-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 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 146b05748459..8fd769eb4d0d 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 Wed Apr 12 14:30:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 1768179 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=B8TJJX21; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxQBK0fD4z1yXv for ; Thu, 13 Apr 2023 00:31:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8564D85F9F; Wed, 12 Apr 2023 16:30:36 +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="B8TJJX21"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D27485F95; Wed, 12 Apr 2023 16:30:20 +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-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (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 82AF885F7A for ; Wed, 12 Apr 2023 16:30:16 +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-x12b.google.com with SMTP id 2adb3069b0e04-4eb36162b32so279456e87.1 for ; Wed, 12 Apr 2023 07:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309816; x=1683901816; 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=Pss8X7bgu3LOS8N22uSYRTMb3NQ6H4RT32F84vbK7nY=; b=B8TJJX211mbvfHkfUvErgBcBsIzIV1ITt1KtOiIPfhSB+GJluwS5eM1IxQsSHfOf14 dAJtRMj7+Rxr6lr6nG3k5lqvVduJtSr+r4ayFS1RBkKddCobP9lMiKcrsCFMHZEIzStD HEvAwQqlXqtBpJRpgtHONwx0qN9R0w1d9Ya6inNbYuMCDV4DuaGsWjiQRO0amOJgEE/J 2om4vDHX/A+uMpQDOjb3cyAgrPhURGooS5R7K/NKSNp1QMdl6CwrmenH+UXxmUvXmSvq sliFgWriyyfFssLZrsPF3SMwK/+1JDYfxB1uc33C/ghlSRy8CufdeI4QynywOXid7FfD +3eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681309816; x=1683901816; 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=Pss8X7bgu3LOS8N22uSYRTMb3NQ6H4RT32F84vbK7nY=; b=uqiB/HWE2dFbtxkR8y6u9aqisQZNvolS7iBPhplMDEP7M2+RIcFfIB6HH42zo78dcf dLxTMJQNWKWBhL3dWvmurC8YLtdCWfFhcs1wFDkdWjF216k1T5HIezZR4XCAlkj0j7QH Ul46ed8VcanMysAZ22up/hnnHKrpiAldOta6f8tPG6S3TOxKCM23nV3XosfY7hOllDy/ YtcbDNTfYlfpdKgixGwzA1S/ELk/+Vwwow9y6JEiAk3YMy0BcTTMQW/VIborPT/i+lnB skROwfJiEvZyv6DnHlGRAhHS39OOlxzlR4ow2zGsVwu3LDmcTaSqcO5hOdLD52kKlgij tVZQ== X-Gm-Message-State: AAQBX9eQFIDOW+XekIhV+u5hjtYoCoHXiwdA5wL/OJWb/VPWEICIMuMP 3atOlrMhPKY3qqZ7BLfO6tQprA== X-Google-Smtp-Source: AKy350bGR+9P3S1Rjxoasxea0N5WcnYHHqc/AD56oylSKvaNKNLaaxJ3nG3pcGB0KnubmtzCP1fTfg== X-Received: by 2002:a2e:b890:0:b0:295:9c3f:e30c with SMTP id r16-20020a2eb890000000b002959c3fe30cmr751512ljp.1.1681309816152; Wed, 12 Apr 2023 07:30:16 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:15 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 5/9] serial: msm-geni: fix code indentation Date: Wed, 12 Apr 2023 17:30:02 +0300 Message-Id: <20230412143006.80946-6-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 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 8fd769eb4d0d..55dd9188a56c 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 Wed Apr 12 14:30:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 1768180 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=M8keWTBb; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxQBX3gXzz1yXv for ; Thu, 13 Apr 2023 00:31:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7751585FFE; Wed, 12 Apr 2023 16:30:45 +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="M8keWTBb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A7DFB85F95; Wed, 12 Apr 2023 16:30:21 +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-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (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 78F1885F89 for ; Wed, 12 Apr 2023 16:30:17 +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-x133.google.com with SMTP id 2adb3069b0e04-4ec81439f04so197551e87.0 for ; Wed, 12 Apr 2023 07:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309817; x=1683901817; 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=ic9B31eSPuTHLg5dKtybI1SMa/YD3tQdPCS7eX5J8pM=; b=M8keWTBb0cO1cckeAOZBGmRc/X96Ot1hpwpQytv9pALwa6mrwx/4hmaFJC/bBdjxVE QsTcj81m9YXFz95iffVgsKE95N7xlBjHn8GyJwe2zYGiWB14IjsrYNj1Pn1hq8wQUqGc GN/oEhLmYetXst1c1oPakQ8PIxeUczWN3Ec3T04k++128Imh6oLtuEPtIgrpLbfoORp4 e0faP9mWfLN0KpXH6M7zbqrARUJYzXNhefKoonToYR5Efr+PsD/2Glsu+j+E/fY5Tih/ yQjQ7cELQF2iPy+gnnzVscrYaV+dK8c0XwkLSEjwNGNMCpJD3E0TJodrMgdiytzcLUfr iKgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681309817; x=1683901817; 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=ic9B31eSPuTHLg5dKtybI1SMa/YD3tQdPCS7eX5J8pM=; b=IL5jJMQ/TC5hefFy2sB3E8pNHj69pT0z2NTuL7U3B76Jn7ju3di08opVQrOvywTTn3 G+icqIYTR/0WrBZw+9fw9Gf50L5Lo9MxbrGsVsKVjABEI67MYz73y2kmx+4pIt6dq8Xt EzG/ZWH6eilVlRVXO9K+UxiDU3YiOWCsgRpEkfn3YFgS71LJaXo13MoLFo9Xqj/FTczC H+Bz80hr/Dx0snw7RCOuGwrzDuPG/TxIYdwbwxeM+c6Xvfiu+X9V3QIezwob/9ItbCSM H33HoSDXhm3cXtg3hwLz7QRlEnCyz3PaTEw7S+KfwTbOBTbsXXs98Sd2f+xhw7pb9ns7 xEuw== X-Gm-Message-State: AAQBX9fj5Lyt2zrfxYbOovq/RW7SBfR91Qtv5iRpPNvOcqe+zmZTITej dlMPy8MvVhFaMSUAMVT1reZ6mw== X-Google-Smtp-Source: AKy350bud/Ta2hBZJfx3LVzB7JHSB2d3eyYSMYjFQ3kl+A4Rm5elAnNty6/R9v0mh49dR8Blpo6SKg== X-Received: by 2002:a2e:a815:0:b0:2a7:9987:571d with SMTP id l21-20020a2ea815000000b002a79987571dmr710902ljq.0.1681309817199; Wed, 12 Apr 2023 07:30:17 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:16 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 6/9] serial: msm-geni: fix a compile time warning from msm_serial_setbrg() Date: Wed, 12 Apr 2023 17:30:03 +0300 Message-Id: <20230412143006.80946-7-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 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 Fixes: 324df15a292e ("serial: qcom: add support for GENI serial driver") 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 55dd9188a56c..3a200f45a6ce 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 Wed Apr 12 14:30:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 1768182 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jFRGIFG2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxQBz0Qnzz1yXv for ; Thu, 13 Apr 2023 00:31:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6305986018; Wed, 12 Apr 2023 16:30:51 +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="jFRGIFG2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1ED0C85F7A; Wed, 12 Apr 2023 16:30:23 +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-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (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 16BA885F72 for ; Wed, 12 Apr 2023 16:30:19 +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-x136.google.com with SMTP id 2adb3069b0e04-4ec816ccb80so196441e87.1 for ; Wed, 12 Apr 2023 07:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309818; x=1683901818; 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=clCMELQO5CTC9bl0ZZC/QKbDsRxs5YKUO3QyeP4FEyI=; b=jFRGIFG2PLJ+XpvJXOSkDSW3gmZV0oVlKgsrKyhK1wz9z6CrR6R9FtZBo1NEqHwmk9 mLQ925Jk5zQN33uGMVbeShfSt0gg2+vZ7/zoC0X0uQipLen8Em3XFFDbBPg83eAOvmE6 Cc1LvMQIKnoOeBJ2wrB12Sbdll2qBHxK5O8uMVw71p+FTnUQV5acfmYDHWjYSlkKVXhc J8Xk4MDU9vFcZ97VbtvUpcBh48B+oJBGeH48W8VuzqIESlehurKF7+ma5bEpI1uh+hmZ L32BHLwyRlVNBxlut5RTBjCFiUTY3HNVGAqpt2R4D9A2nuVvrukFvj9rj3vCCgaaK3gZ PK2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681309818; x=1683901818; 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=clCMELQO5CTC9bl0ZZC/QKbDsRxs5YKUO3QyeP4FEyI=; b=zPJxqlBZo4jtH0qPbGgMfD3Kzr4HOrWrQy60eejmh9FqKlKbGnxEp0kxVATIpvAZqR 43i1U62xmIYOk1EKBh7Wg6CUlLfX179Ed/42XUM0wFCKabk1WM9DPmbEinNG6E0ZJ1Xe btzeY9FHrJxbrZNRT1N3WHbnmCD5QsiyFNEt40t/M41crC73iUa4K8LQ17vNqcbVaKqL WAwaH7rxa3amldoucC5a9qMfIFTQVEm/OBIvtqhdebfuFxHp3ahqTpbrVtNEMs3+9JZP iu9W13Qt+Lw1Z9o1vLgZqo/6Qjr8nrncOvnNurLkt925NmHaYmYM1mnfi7P3/zcrltEk iK/A== X-Gm-Message-State: AAQBX9cq90Aw/7G8zbWyFGzWJphJ1P8tGx8I6i3g2JO/e1QuQuxt65Vp HrDlTxKSA5u1a9XnJQvX0zyPeatzYOioxzhDb1SXog== X-Google-Smtp-Source: AKy350b+nFBI/ul1wShXALlf9OUEnHoEmWxPwrNjXtLSnH4g++BMj+oH0GC42qtWH7udrq5xG6ihaw== X-Received: by 2002:a05:651c:1607:b0:2a7:970a:1c1b with SMTP id f7-20020a05651c160700b002a7970a1c1bmr719715ljq.3.1681309818344; Wed, 12 Apr 2023 07:30:18 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:17 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 7/9] serial: msm-geni: Use upstream Linux bindings Date: Wed, 12 Apr 2023 17:30:04 +0300 Message-Id: <20230412143006.80946-8-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 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 From: Konrad Dybcio The name "se" is used in upstream Linux device trees and has been for ages, long before this U-Boot-ism was introduced. Same goes for the existing compatible. Get rid of that. [vzapolskiy: removed a ready change in the driver] Signed-off-by: Konrad Dybcio Signed-off-by: Vladimir Zapolskiy --- arch/arm/dts/sdm845.dtsi | 4 ++-- doc/device-tree-bindings/serial/msm-geni-serial.txt | 2 +- drivers/serial/serial_msm_geni.c | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/dts/sdm845.dtsi b/arch/arm/dts/sdm845.dtsi index 607af277f8be..92bdc82177d6 100644 --- a/arch/arm/dts/sdm845.dtsi +++ b/arch/arm/dts/sdm845.dtsi @@ -52,10 +52,10 @@ }; debug_uart: serial@a84000 { - compatible = "qcom,msm-geni-uart"; + compatible = "qcom,geni-debug-uart"; reg = <0xa84000 0x4000>; reg-names = "se_phys"; - clock-names = "se-clk"; + clock-names = "se"; clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>; pinctrl-names = "default"; pinctrl-0 = <&qup_uart9>; diff --git a/doc/device-tree-bindings/serial/msm-geni-serial.txt b/doc/device-tree-bindings/serial/msm-geni-serial.txt index 9eadc2561b4b..eaa39c949b10 100644 --- a/doc/device-tree-bindings/serial/msm-geni-serial.txt +++ b/doc/device-tree-bindings/serial/msm-geni-serial.txt @@ -1,6 +1,6 @@ Qualcomm GENI UART Required properties: -- compatible: must be "qcom,msm-geni-uart" +- compatible: must be "qcom,geni-debug-uart" - reg: start address and size of the registers - clock: interface clock (must accept baudrate as a frequency) diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index 3a200f45a6ce..29fae810d6fe 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -547,7 +547,9 @@ static int msm_serial_ofdata_to_platdata(struct udevice *dev) } static const struct udevice_id msm_serial_ids[] = { - {.compatible = "qcom,msm-geni-uart"}, {}}; + { .compatible = "qcom,geni-debug-uart" }, + { } +}; U_BOOT_DRIVER(serial_msm_geni) = { .name = "serial_msm_geni", From patchwork Wed Apr 12 14:30:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 1768181 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=aNDqeV0K; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxQBm1686z1yXv for ; Thu, 13 Apr 2023 00:31:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9274885F9D; Wed, 12 Apr 2023 16:30: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=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="aNDqeV0K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E712985F9D; Wed, 12 Apr 2023 16:30:22 +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-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (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 010E685F88 for ; Wed, 12 Apr 2023 16:30:19 +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-x136.google.com with SMTP id 2adb3069b0e04-4ec816ccb80so196443e87.1 for ; Wed, 12 Apr 2023 07:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309819; x=1683901819; 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=q+IN99fyNd9MTSH6CRsJmtiRUV3HScQXLXTSdG52Y3Q=; b=aNDqeV0Kh7zGqm+iXDxV3Y9Qv9HgNPEuKNB327X+k6WoDlbqfID0FuV+F6pFxzb+vP QtcfkVEXQ4IFgRL0gZOXJHmjsU2zHLtVt7oL+jBKBnQEv1hObIC7U/3fOf339JVCqJUg N5uwX9alc8lJEJbUtwqSkQ7A42RQNhwIUp07djQ8afpI/rME6J4Wg5JUsMplFrFO5Te5 bfjcux/17uziTf5seCPYp2AgtqjuxiwM8ZS8OMVszySu2pbMB5iYAQ4delmztgL1QTMw zeIsrYaj/pBnQeiUm6/7cmSf0INerlBouC8EM/hCrHnI4xwFRamRvC9cahPbAisVyJsr miFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681309819; x=1683901819; 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=q+IN99fyNd9MTSH6CRsJmtiRUV3HScQXLXTSdG52Y3Q=; b=KKkDc+VVnSQ2zhqg3AU23q4RBiKzHPdNAv93/GARASu8o5ddUW32ot/k85FM3wA+bx kj2A6Y6z14KecU/bjXgGSackbAvG1uKlck2kV5mffXvorXM/GAiwfhDVvd+dMB+bLSnx tLlDXJKBwADDs0ulg9t6jB6m3EwL0BNfgpnVy/uzTOEVgRmQpFoYXxYwXPBxuLi6btHa Xzatgk2LSHiIfgHGKayxe+U4xu3PK/HfBgW0z6/a7RLs84Ei0mkj9I/ye0XdbUuokw56 yazQwrnMVRO3Qu1isdbENyozgvTPx+fGd5bqV+mURxl2a4gkplUB3jGKLfVQLeQuu0bA FiUA== X-Gm-Message-State: AAQBX9cDizQtheV0/af9fSMNURgHB3a7KyoZ8VXhiBkzQir9/Fznb886 f4RtN81nL1RugXp+rMv+qzOm8w== X-Google-Smtp-Source: AKy350a/C0/PoFd1RbL9M4YUmsQufGy/CibMy+yL5IKexiXsjnakcpmalgNjfs4/MDyWa0P0iXiuVg== X-Received: by 2002:a05:651c:1607:b0:2a7:970a:1c1b with SMTP id f7-20020a05651c160700b002a7970a1c1bmr719754ljq.3.1681309819689; Wed, 12 Apr 2023 07:30:19 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:18 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 8/9] serial: msm-geni: correct oversampling value based on QUP hardware revision Date: Wed, 12 Apr 2023 17:30:05 +0300 Message-Id: <20230412143006.80946-9-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 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/Kconfig | 2 ++ drivers/serial/serial_msm_geni.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 10d07daf2777..7faf67844424 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -946,6 +946,8 @@ config MSM_SERIAL config MSM_GENI_SERIAL bool "Qualcomm on-chip GENI UART" + select MISC + imply QCOM_GENI_SE help Support UART based on Generic Interface (GENI) Serial Engine (SE), used on Qualcomm Snapdragon SoCs. Should support all qualcomm SOCs diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index 29fae810d6fe..b76ed3a30017 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,28 @@ static const struct dm_serial_ops msm_serial_ops = { .setbrg = msm_serial_setbrg, }; +static void geni_set_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 IP is missing in the board's device + * tree or GENI UART 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, sizeof(geni_se_version)); + 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 +551,8 @@ static int msm_serial_probe(struct udevice *dev) { struct msm_serial_data *priv = dev_get_priv(dev); + geni_set_oversampling(dev); + /* No need to reinitialize the UART after relocation */ if (gd->flags & GD_FLG_RELOC) return 0; From patchwork Wed Apr 12 14:30:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 1768183 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Sa0csSfx; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PxQCB308Vz1yXv for ; Thu, 13 Apr 2023 00:32:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1F2CC86023; Wed, 12 Apr 2023 16:30:54 +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="Sa0csSfx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4D6D185F89; Wed, 12 Apr 2023 16:30:26 +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-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (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 8B18285F77 for ; Wed, 12 Apr 2023 16:30:21 +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-x133.google.com with SMTP id 2adb3069b0e04-4ec81439f04so197554e87.0 for ; Wed, 12 Apr 2023 07:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681309821; x=1683901821; 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=wup+CBY6u7TSY4TeWQWa9so56VwP6kLw4QvYwq6be98=; b=Sa0csSfxy6CQOm3Wjc/iVAoqPMTPTqGw4QkkN33T0ubA+yZL/8PRVuxK4R0Jdb+4Zu 5yDgQxuhewklwC3k491ZPQ6SOiTgnvH7HQP+Ul/uz9LfNv1TVsAr0Tiopcd2z1ggKHIu hvppteVkxNIGVEdXbs6UoYyLinE8uaVy3zFfWbJ1joB6n++WiC6Lm9EUBKiqUfdZwXzA DdYt1loSpHLefHh39Owd0gzlf0CBDxXMDr1LMoG3YpB4t8K2wgeRK2M2Ukad6AAci/iI KxWl8HT/zjlneJ96tYTzTkY1rPYTeczx7EgbyqPaibyQILfnhjMfiOrbqPIiHOh4igjp 6j+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681309821; x=1683901821; 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=wup+CBY6u7TSY4TeWQWa9so56VwP6kLw4QvYwq6be98=; b=a+mHAlFFNO63/PJeoOfim0v/YTvRiMvYxh7Y614EA2P30ddJR/XkHYbUS3lirLtD0/ wVUKXey3u4IJ7pYDC03i2MPtwPwCkyWBCmSGUghh6q9WYwQhjPBXpOzsqDaKvndnch0p 11Ca8SG8Y5Ge1Fos29Azqmk0jNxPVGqO2avCjaIostxwelMsyC24m1UU4uNDpBE/fQBe 8sQHklW6LbDQhSSS+sSjzdeaupH7bHMil5E1XDhrEMeRkyKViCyFI3isPrPuUg8+u87H 8adOO1ruQ8o06R6c7m9vfcqDWGOmGd+taI92Xz7VFFeXwoqteoLsQr7RfZttNrytXzKD INsg== X-Gm-Message-State: AAQBX9flXWAi6dV4wJ4fonxPykHs68v4yO7kQCjJ0iLcqjMDNIQ4lz8P Ux6UDG/rG7sT5nhJegBeh7J5lg== X-Google-Smtp-Source: AKy350Y834A7dcH6h7o4p0jGWRsrOZOyGK70PTHzxzuMVrWrzQDn1wbWfKdznI0hm7epde/enFOr4A== X-Received: by 2002:a2e:b890:0:b0:2a6:1681:d82f with SMTP id r16-20020a2eb890000000b002a61681d82fmr863708ljp.1.1681309821313; Wed, 12 Apr 2023 07:30:21 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8e82000000b002a7729eea3dsm1861054ljk.88.2023.04.12.07.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 07:30:20 -0700 (PDT) From: Vladimir Zapolskiy To: Tom Rini , Simon Glass Cc: Ramon Fried , Konrad Dybcio , Bhupesh Sharma , u-boot@lists.denx.de Subject: [PATCH v2 9/9] arm: dts: sdm845: add GENI SE QUP device tree node Date: Wed, 12 Apr 2023 17:30:06 +0300 Message-Id: <20230412143006.80946-10-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> References: <20230412143006.80946-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 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 On modern Qualcomm platforms including SDM845 a GENI SE QUP IP description is supposed to be found in board device tree nodes, the version of the IP is used by the GENI UART driver to properly set an oversampling divider value, which impacts UART baudrate. The change touches dragonboard845c and starqltechn board device tree source files, a device tree node label to "debug" UART is renamed to 'uart9' according to the naming found in Linux. Signed-off-by: Vladimir Zapolskiy --- arch/arm/dts/dragonboard845c.dts | 2 +- arch/arm/dts/sdm845.dtsi | 25 +++++++++++++++---------- arch/arm/dts/starqltechn.dts | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/arch/arm/dts/dragonboard845c.dts b/arch/arm/dts/dragonboard845c.dts index 1722dce33ff2..b4f057ac6537 100644 --- a/arch/arm/dts/dragonboard845c.dts +++ b/arch/arm/dts/dragonboard845c.dts @@ -21,7 +21,7 @@ }; aliases { - serial0 = &debug_uart; + serial0 = &uart9; }; memory { diff --git a/arch/arm/dts/sdm845.dtsi b/arch/arm/dts/sdm845.dtsi index 92bdc82177d6..3b86b9328fc6 100644 --- a/arch/arm/dts/sdm845.dtsi +++ b/arch/arm/dts/sdm845.dtsi @@ -51,16 +51,21 @@ }; }; - debug_uart: serial@a84000 { - compatible = "qcom,geni-debug-uart"; - reg = <0xa84000 0x4000>; - reg-names = "se_phys"; - clock-names = "se"; - clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>; - pinctrl-names = "default"; - pinctrl-0 = <&qup_uart9>; - qcom,wrapper-core = <0x8a>; - status = "disabled"; + qupv3_id_1: geniqup@ac0000 { + compatible = "qcom,geni-se-qup"; + reg = <0x00ac0000 0x6000>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + uart9: serial@a84000 { + compatible = "qcom,geni-debug-uart"; + reg = <0xa84000 0x4000>; + clock-names = "se"; + clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>; + pinctrl-names = "default"; + pinctrl-0 = <&qup_uart9>; + }; }; spmi@c440000 { diff --git a/arch/arm/dts/starqltechn.dts b/arch/arm/dts/starqltechn.dts index 34a4f59cbd17..dcbc3b6d4966 100644 --- a/arch/arm/dts/starqltechn.dts +++ b/arch/arm/dts/starqltechn.dts @@ -21,7 +21,7 @@ }; aliases { - serial0 = &debug_uart; + serial0 = &uart9; }; memory {