From patchwork Sun Apr 24 08:21:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viacheslav Bocharov X-Patchwork-Id: 1621479 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lexina.in header.i=@lexina.in header.a=rsa-sha256 header.s=dkim header.b=QclYQl5G; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KmLjt1zMJz9s0w for ; Sun, 24 Apr 2022 18:22:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0660F83DD4; Sun, 24 Apr 2022 10:22:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in 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=lexina.in header.i=@lexina.in header.b="QclYQl5G"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D23D083E31; Sun, 24 Apr 2022 10:22: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 mx.msync.work (mx.msync.work [185.250.0.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A88E383E03 for ; Sun, 24 Apr 2022 10:22:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=adeep@lexina.in Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 421E152F24; Sun, 24 Apr 2022 08:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1650788528; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=MzEBO7DE9auqkZnesEKiPZANXiFvvuJ7g/vtaA+7ERI=; b=QclYQl5GmX6OYyG20/bzOqJaJLlfrjAek18QGdIcK8dvx1OV9CpaTx519Va2YBV38G3x82 xoLRcYr8C/UHzfMZiK8wGqtl77cwOZNxXA1IjqlYPrPQn8EZPZDV0moNhCOuR2ZYyAv6q4 UxuzmiDfThq3mrXbq2gmciPbFj591kyDMROoLxoVIJ4DQXcECZt6VqD71V4yiE1CxzISSZ u553HnVLBXhpWlk7pnoLCLNzh1Q1uufuQOA4H4stsXSRYDiY33EFddxzkcDqXShoFcM93l 0HMs7yDciAMfPtJLBH1T0N23ooKosnt1L9774NmiDMJH/yOZpJS6kae8HAQi1w== From: Vyacheslav Bocharov To: Neil Armstrong , Lukasz Majewski , Sean Anderson , u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [PATCH v3 1/6] clk: meson: add minimal driver for axg-ao clocks Date: Sun, 24 Apr 2022 11:21:54 +0300 Message-Id: <20220424082159.757622-2-adeep@lexina.in> In-Reply-To: <20220424082159.757622-1-adeep@lexina.in> References: <20220424082159.757622-1-adeep@lexina.in> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 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.5 at phobos.denx.de X-Virus-Status: Clean Add minimal driver AO clocks on meson AXG family. Only ADC related clocks are supported. Signed-off-by: Vyacheslav Bocharov Reviewed-by: Sean Anderson Reviewed-by: Neil Armstrong --- drivers/clk/meson/Makefile | 1 + drivers/clk/meson/axg-ao.c | 86 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 drivers/clk/meson/axg-ao.c diff --git a/drivers/clk/meson/Makefile b/drivers/clk/meson/Makefile index b9c6bd66cf..a486b13e9c 100644 --- a/drivers/clk/meson/Makefile +++ b/drivers/clk/meson/Makefile @@ -5,5 +5,6 @@ obj-$(CONFIG_CLK_MESON_GX) += gxbb.o obj-$(CONFIG_CLK_MESON_AXG) += axg.o +obj-$(CONFIG_CLK_MESON_AXG) += axg-ao.o obj-$(CONFIG_CLK_MESON_G12A) += g12a.o obj-$(CONFIG_CLK_MESON_G12A) += g12a-ao.o diff --git a/drivers/clk/meson/axg-ao.c b/drivers/clk/meson/axg-ao.c new file mode 100644 index 0000000000..311ffc1cca --- /dev/null +++ b/drivers/clk/meson/axg-ao.c @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "clk_meson.h" + +struct meson_clk { + struct regmap *map; +}; + +#define AO_CLK_GATE0 0x40 +#define AO_SAR_CLK 0x90 + +static struct meson_gate gates[] = { + MESON_GATE(CLKID_AO_SAR_ADC, AO_CLK_GATE0, 7), + MESON_GATE(CLKID_AO_SAR_ADC_CLK, AO_SAR_CLK, 7), +}; + +static int meson_set_gate(struct clk *clk, bool on) +{ + struct meson_clk *priv = dev_get_priv(clk->dev); + struct meson_gate *gate; + + gate = &gates[clk->id]; + + regmap_update_bits(priv->map, gate->reg, + BIT(gate->bit), on ? BIT(gate->bit) : 0); + + return 0; +} + +static int meson_clk_enable(struct clk *clk) +{ + return meson_set_gate(clk, true); +} + +static int meson_clk_disable(struct clk *clk) +{ + return meson_set_gate(clk, false); +} + +static int meson_clk_probe(struct udevice *dev) +{ + struct meson_clk *priv = dev_get_priv(dev); + + priv->map = syscon_node_to_regmap(dev_ofnode(dev_get_parent(dev))); + if (IS_ERR(priv->map)) + return PTR_ERR(priv->map); + + return 0; +} + +static int meson_clk_request(struct clk *clk) +{ + if (clk->id >= ARRAY_SIZE(gates)) + return -ENOENT; + + return 0; +} + +static struct clk_ops meson_clk_ops = { + .disable = meson_clk_disable, + .enable = meson_clk_enable, + .request = meson_clk_request, +}; + +static const struct udevice_id meson_clk_ids[] = { + { .compatible = "amlogic,meson-axg-aoclkc" }, + { } +}; + +U_BOOT_DRIVER(meson_clk_axg_ao) = { + .name = "meson_clk_axg_ao", + .id = UCLASS_CLK, + .of_match = meson_clk_ids, + .priv_auto = sizeof(struct meson_clk), + .ops = &meson_clk_ops, + .probe = meson_clk_probe, +}; From patchwork Sun Apr 24 08:21:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viacheslav Bocharov X-Patchwork-Id: 1621480 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lexina.in header.i=@lexina.in header.a=rsa-sha256 header.s=dkim header.b=qOifpRNN; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KmLjy1Nblz9s0w for ; Sun, 24 Apr 2022 18:22:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9648283E30; Sun, 24 Apr 2022 10:22:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in 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=lexina.in header.i=@lexina.in header.b="qOifpRNN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E7F883E30; Sun, 24 Apr 2022 10:22: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=unavailable autolearn_force=no version=3.4.2 Received: from mx.msync.work (mx.msync.work [185.250.0.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E747583E31 for ; Sun, 24 Apr 2022 10:22:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=adeep@lexina.in Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 05D3152F28; Sun, 24 Apr 2022 08:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1650788529; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=d9TvfXh0qjmQ1x8biKX06Pj+UALtxRFt30djTpjYG/Y=; b=qOifpRNNjATKIyBocTcUijzqy1q1dT0SIG7vzuy5/il2X8y2pwojhgu+BiEsRBgd8tNFYZ SmOpIavIz+728Dy/9zgQHxrv80FooPKpWv+bJ7dNeLA49DFJ+xNE+L5qoMLCRhzRjVlkqr G6GISau7bXG9tXsVppyn08vpto2vfGgUB8t0B9Cz4DT4Q1LQac+sAx1Czr0kHOksg51zk3 yMlCinn1BEY5HAdNVUEklWYwkCMk4uRLBTfUIV1FLBbT79ei2ZExucH7VtHq1817kK6Uzc VD2z2YkdoZAkHOyEtAIRaVlv6MlZS/3CT86FAlp36fOGu7DZGNOmfb6KJWpvVw== From: Vyacheslav Bocharov To: Neil Armstrong , Lukasz Majewski , Sean Anderson , u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [PATCH v3 2/6] clk: meson: fix driver name for g12a-ao clocks Date: Sun, 24 Apr 2022 11:21:55 +0300 Message-Id: <20220424082159.757622-3-adeep@lexina.in> In-Reply-To: <20220424082159.757622-1-adeep@lexina.in> References: <20220424082159.757622-1-adeep@lexina.in> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 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.5 at phobos.denx.de X-Virus-Status: Clean Update the clk-g12a-ao driver from "axg" to "g12a" Signed-off-by: Vyacheslav Bocharov Acked-by: Neil Armstrong --- drivers/clk/meson/g12a-ao.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/meson/g12a-ao.c b/drivers/clk/meson/g12a-ao.c index 0148529e04..17b11eb52a 100644 --- a/drivers/clk/meson/g12a-ao.c +++ b/drivers/clk/meson/g12a-ao.c @@ -73,7 +73,7 @@ static const struct udevice_id meson_clk_ids[] = { { } }; -U_BOOT_DRIVER(meson_clk_axg) = { +U_BOOT_DRIVER(meson_clk_g12a_ao) = { .name = "meson_clk_g12a_ao", .id = UCLASS_CLK, .of_match = meson_clk_ids, From patchwork Sun Apr 24 08:21:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viacheslav Bocharov X-Patchwork-Id: 1621481 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lexina.in header.i=@lexina.in header.a=rsa-sha256 header.s=dkim header.b=QfnvLTo4; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KmLk83c8Pz9s0w for ; Sun, 24 Apr 2022 18:22:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C577C83E57; Sun, 24 Apr 2022 10:22:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in 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=lexina.in header.i=@lexina.in header.b="QfnvLTo4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB16183DFE; Sun, 24 Apr 2022 10:22: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 mx.msync.work (mx.msync.work [185.250.0.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3E4F883E3B for ; Sun, 24 Apr 2022 10:22:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=adeep@lexina.in Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5D66E52F2A; Sun, 24 Apr 2022 08:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1650788529; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=hCyvAledVEA5jmOB5QU6iGsaTZiPZy2ZrPaf1mSVERE=; b=QfnvLTo4z2fzn/WVa1FlRc+k1PUi52ryBiLDFyhSPD3mal30re1sKUAQsf7L/ZRIZ/fhMg 3ziR7/CtOeqmcyTBHbVjD2GmxQHg94FsfZzfy9OEBo8M3Abnk22CfQ1iq+O0F/PjOwKk7u /GKaXsRCeMKUH05A1tmfWJdMqvsoFqSrjELZgGUwHvyx4B0WPykoOmpX7Dh6K61ZZf2SBj XRySziF/X9eLQkgyt0LTjoFVfkNL/c8DjrZC7qG2QDBu2bAV2KDiJW0bdpvrYR1Qps6fC4 41tYYv/zwTv1yAVcdemz3mAFuSZcN3qDmUDi3fZOB9hG8OgB45CHR6V2HXURWw== From: Vyacheslav Bocharov To: Neil Armstrong , Lukasz Majewski , Sean Anderson , u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [PATCH v3 3/6] clk: meson: update driver for g12a-ao clocks Date: Sun, 24 Apr 2022 11:21:56 +0300 Message-Id: <20220424082159.757622-4-adeep@lexina.in> In-Reply-To: <20220424082159.757622-1-adeep@lexina.in> References: <20220424082159.757622-1-adeep@lexina.in> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 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.5 at phobos.denx.de X-Virus-Status: Clean Update g12a-ao clk driver: - move clk->id check to .request function - remove unnecessary check (gate->reg == 0) Signed-off-by: Vyacheslav Bocharov Acked-by: Neil Armstrong --- drivers/clk/meson/g12a-ao.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/clk/meson/g12a-ao.c b/drivers/clk/meson/g12a-ao.c index 17b11eb52a..1a855a6896 100644 --- a/drivers/clk/meson/g12a-ao.c +++ b/drivers/clk/meson/g12a-ao.c @@ -28,14 +28,8 @@ static int meson_set_gate(struct clk *clk, bool on) struct meson_clk *priv = dev_get_priv(clk->dev); struct meson_gate *gate; - if (clk->id >= ARRAY_SIZE(gates)) - return -ENOENT; - gate = &gates[clk->id]; - if (gate->reg == 0) - return 0; - regmap_update_bits(priv->map, gate->reg, BIT(gate->bit), on ? BIT(gate->bit) : 0); @@ -63,9 +57,18 @@ static int meson_clk_probe(struct udevice *dev) return 0; } +static int meson_clk_request(struct clk *clk) +{ + if (clk->id >= ARRAY_SIZE(gates)) + return -ENOENT; + + return 0; +} + static struct clk_ops meson_clk_ops = { .disable = meson_clk_disable, .enable = meson_clk_enable, + .request = meson_clk_request, }; static const struct udevice_id meson_clk_ids[] = { From patchwork Sun Apr 24 08:21:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viacheslav Bocharov X-Patchwork-Id: 1621482 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lexina.in header.i=@lexina.in header.a=rsa-sha256 header.s=dkim header.b=C74TepAV; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KmLkL6pfgz9s0w for ; Sun, 24 Apr 2022 18:23:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8701683E63; Sun, 24 Apr 2022 10:22:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in 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=lexina.in header.i=@lexina.in header.b="C74TepAV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EBFFA83A9D; Sun, 24 Apr 2022 10:22:19 +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=unavailable autolearn_force=no version=3.4.2 Received: from mx.msync.work (mx.msync.work [185.250.0.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8E1A983E4C for ; Sun, 24 Apr 2022 10:22:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=adeep@lexina.in Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AA1E152EC8; Sun, 24 Apr 2022 08:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1650788529; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=f/xrZ9j5v4f1Ae1i0PgTc+2kGsjiNvYtN+GyPxvdUfE=; b=C74TepAVYZTCC5R4yV8xXvoSvRTa7HOeXcWYxoRyT3Erf2A6mqBbZtNy50q12Lofcf66iw aNfXTtz/YvAhDY79jD8pazDKfGJrZTt1xe9F0U2Epph+W55VBRGTVPdq58UWToWyEBfIrZ YGBL3/F3FLiRrLZTpc20f+atsVVZWPevcwqKj+Cry4iJePArGIJlHFJpWnb5KzGN7sVfW6 MU3jmdE5yQFQN77Coksny6/g15suRDbuzUXXJFEhy5GsSNJQkHh789EYN+AkFxWWfjw6iu 1OO6hv/P798jhr549dIvCPP5p6m+RaT2KdHDwSZXED6CkmvG/Eo0OCA2DdI2+g== From: Vyacheslav Bocharov To: Neil Armstrong , Lukasz Majewski , Sean Anderson , u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [PATCH v3 4/6] adc: meson-saradc: add AXG variant Date: Sun, 24 Apr 2022 11:21:57 +0300 Message-Id: <20220424082159.757622-5-adeep@lexina.in> In-Reply-To: <20220424082159.757622-1-adeep@lexina.in> References: <20220424082159.757622-1-adeep@lexina.in> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 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.5 at phobos.denx.de X-Virus-Status: Clean Add support for the SARADC variant found on the AXG SoCs family. Signed-off-by: Vyacheslav Bocharov Acked-by: Neil Armstrong --- drivers/adc/meson-saradc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/adc/meson-saradc.c b/drivers/adc/meson-saradc.c index 1a45a3a265..37023512f0 100644 --- a/drivers/adc/meson-saradc.c +++ b/drivers/adc/meson-saradc.c @@ -737,6 +737,8 @@ static const struct udevice_id meson_saradc_ids[] = { .data = (ulong)&gxl_saradc_data }, { .compatible = "amlogic,meson-g12a-saradc", .data = (ulong)&gxl_saradc_data }, + { .compatible = "amlogic,meson-axg-saradc", + .data = (ulong)&gxl_saradc_data }, { } }; From patchwork Sun Apr 24 08:21:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viacheslav Bocharov X-Patchwork-Id: 1621484 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lexina.in header.i=@lexina.in header.a=rsa-sha256 header.s=dkim header.b=i262aVEM; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KmLkp0NTwz9s0w for ; Sun, 24 Apr 2022 18:23:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 16EF383E71; Sun, 24 Apr 2022 10:22:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in 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=lexina.in header.i=@lexina.in header.b="i262aVEM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4904A83E31; Sun, 24 Apr 2022 10:22: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=unavailable autolearn_force=no version=3.4.2 Received: from mx.msync.work (mx.msync.work [185.250.0.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D2F6983953 for ; Sun, 24 Apr 2022 10:22:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=adeep@lexina.in Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0D9D252EC9; Sun, 24 Apr 2022 08:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1650788530; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=wSL+KQbIibmn4+AX8eTgD0llF+CxA4RZtYNA53J/qus=; b=i262aVEM7ZI2l1VeX12ZEWiDw4cZqQvKHHAjz7XJCIt6p+7KDwfCwHKdz3BzXntOd3JhZo 3eMtw946WxdTnnBs9YsuSYQ7PDWW3CYAF9TiCN7gv6no7ait1f7SmrBlPKJaS6RtlY8isc XUHnbsgO70vPImMhXHJqkeSKDzBYmN1i4YjorsMgktZx6G+l3jhFVkosMbReQK2bE6YwG+ hFiJkvTulLzdaQFWrAiBkpxZK1zuTpkGRxyFNImGzJLwgSUZ/XG5V60l+SpdvQE479qNYF ppSLqAoELjCUpG0RShGaHrYvIXG3Rp6q7qURJrWGiRBd00Qsw4kbEMcpPLcUYg== From: Vyacheslav Bocharov To: Neil Armstrong , Lukasz Majewski , Sean Anderson , u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [PATCH v3 5/6] board: amlogic: jethub j100: enable saradc in dts Date: Sun, 24 Apr 2022 11:21:58 +0300 Message-Id: <20220424082159.757622-6-adeep@lexina.in> In-Reply-To: <20220424082159.757622-1-adeep@lexina.in> References: <20220424082159.757622-1-adeep@lexina.in> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 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.5 at phobos.denx.de X-Virus-Status: Clean Prepare to use ADC channel 1 to check the hardware revision of the board: - add u-boot dts include with saradc node Signed-off-by: Vyacheslav Bocharov Reviewed-by: Neil Armstrong --- arch/arm/dts/meson-axg-jethome-jethub-j100-u-boot.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 arch/arm/dts/meson-axg-jethome-jethub-j100-u-boot.dtsi diff --git a/arch/arm/dts/meson-axg-jethome-jethub-j100-u-boot.dtsi b/arch/arm/dts/meson-axg-jethome-jethub-j100-u-boot.dtsi new file mode 100644 index 0000000000..3ecb233f8e --- /dev/null +++ b/arch/arm/dts/meson-axg-jethome-jethub-j100-u-boot.dtsi @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2022 Vyacheslav Bocharov + * Author: Vyacheslav Bocharov + */ + +&saradc { + status = "okay"; + vref-supply = <&vddio_ao18>; +}; From patchwork Sun Apr 24 08:21:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viacheslav Bocharov X-Patchwork-Id: 1621483 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lexina.in header.i=@lexina.in header.a=rsa-sha256 header.s=dkim header.b=HkwLNzs6; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KmLkZ5Psbz9s0w for ; Sun, 24 Apr 2022 18:23:18 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF66583E5F; Sun, 24 Apr 2022 10:22:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in 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=lexina.in header.i=@lexina.in header.b="HkwLNzs6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F09BF83E30; Sun, 24 Apr 2022 10:22: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 mx.msync.work (mx.msync.work [185.250.0.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3ABF583E5D for ; Sun, 24 Apr 2022 10:22:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lexina.in Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=adeep@lexina.in Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5AE3352ECA; Sun, 24 Apr 2022 08:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1650788530; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=c9TDDL81pqutqfD5CmSuE8RTtZR60o7ccaoZlTd8nyQ=; b=HkwLNzs6Z98AWCgEAel2v8YJjY82Yk4fqOjUVbw+DtmxwFyXsw+6sZKaZpGx/juGpMCDrJ AAPgIOOhp1KusIys3V2JfAuJHF9JAd1Moqdb1HFpAKGSkohdheHjhu7LAsV7lUO2tQMrfh maZDI3f2rsSUlK/DNJlWzvfgEcDI/oDf3oejLimNze2ZBjSM/Q2HZwNYtgfeWc0PHdaotL sqZpYGyCdRF+TVLWq4tYutTCeHLLlCO2c8o9NclBJ5G9Npp/U8gr84Pi38f9AhB2IQS5IP s+3YFQvcwKCT0Lg6qlTzcihTJVMueOE2JE+cLXenKIgJN/R00mMtId0dQbskXw== From: Vyacheslav Bocharov To: Neil Armstrong , Lukasz Majewski , Sean Anderson , u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [PATCH v3 6/6] board: amlogic: jethub j100: enable saradc in config Date: Sun, 24 Apr 2022 11:21:59 +0300 Message-Id: <20220424082159.757622-7-adeep@lexina.in> In-Reply-To: <20220424082159.757622-1-adeep@lexina.in> References: <20220424082159.757622-1-adeep@lexina.in> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 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.5 at phobos.denx.de X-Virus-Status: Clean Enable ADC in board config file Signed-off-by: Vyacheslav Bocharov Reviewed-by: Neil Armstrong Reviewed-by: Neil Armstrong --- configs/jethub_j100_defconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configs/jethub_j100_defconfig b/configs/jethub_j100_defconfig index 1c6db9f6a0..a30940bf1c 100644 --- a/configs/jethub_j100_defconfig +++ b/configs/jethub_j100_defconfig @@ -17,6 +17,7 @@ CONFIG_REMAKE_ELF=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_MISC_INIT_R=y +CONFIG_CMD_ADC=y # CONFIG_CMD_BDI is not set # CONFIG_CMD_IMI is not set CONFIG_CMD_EEPROM=y @@ -34,6 +35,10 @@ CONFIG_OF_CONTROL=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_MESON=y +CONFIG_ADC=y +CONFIG_SARADC_MESON=y +CONFIG_CLK=y +CONFIG_CLK_MESON_AXG=y CONFIG_MMC_MESON_GX=y CONFIG_MTD_UBI=y CONFIG_PHY_REALTEK=y