From patchwork Thu Apr 6 15:38:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 1766290 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=pcBwhGzd; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PsphY0JFlz1yYs for ; Fri, 7 Apr 2023 03:41:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD2AF8609F; Thu, 6 Apr 2023 19:41:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="pcBwhGzd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3115A86043; Thu, 6 Apr 2023 17:38:32 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (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 012B086052 for ; Thu, 6 Apr 2023 17:38:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jneanne@baylibre.com Received: by mail-wm1-x32e.google.com with SMTP id m6-20020a05600c3b0600b003ee6e324b19so23969173wms.1 for ; Thu, 06 Apr 2023 08:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680795508; x=1683387508; 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=CmdOexAfFzRuXmvjg6gX67VctusIFr/IriunDeFluao=; b=pcBwhGzdIurG2G5pASGRxeJP8c7ZZ3bBlPK4n636396RiCI6fMYwsMo4BrS+TljH8B m4kPW6CZGWo0lRjZO3N4kx8NoVlk63YfdeaQDidy1saoY4JLiUZepjFu+RQsbsEoDsyI RmUA+COmChyej6rKFdbK815+Lxz18GhG03V/iADrl93rg55kG+53XIZPq/3yeKhG6kbT p7XGCfPheEEvtGEUJ8xMJngK72MRYdmbMLNPQSjBKuNy+Jdr+diO7B8TmvIOmrrYMd+L vTHFe9R/jfbegn4FxZFEP7B/NtpGQFR3i+0t7nYtIGW6kxDN9J14SnTD4eTSGZX5PV6R FNWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795508; x=1683387508; 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=CmdOexAfFzRuXmvjg6gX67VctusIFr/IriunDeFluao=; b=Wxn1+c95uaP89APiFW+tHK51fLe8k0S8HspImzxXZsB0XMpLHeQ0qBbj3ATaSv3Tln NxrBkaEBEnXeeF9hQhC1tuMuaNcxnqzEWD/f2RMIe0w20eSkANOBlOSNDIke2c5ji5Lg +XBy9WTeHZPRySY358C2rkWUS1SVxj1yIGZlSOe6HBbLwpO28RI/KfuW/1r7FanQEeiM O6mCe+KbLlsSwpERezkfo5YoadxFXd5FLaaDDcB4z8mw7mQOgpkcxPwE/l2AqLvVFfsq G1iUxtd0r61mmhnxTO7Gpe+4/anG6dPb9h4I0ZIi53/89KKo61kIsEh4lbg8vXGtGJCw PXNg== X-Gm-Message-State: AAQBX9cHWRwysAgo7P5snEiNQnbyWxCP47T6EsFRfeuH813kswRCSyo6 XVotzRdQupRWr0MGzbEOIfOyaQ== X-Google-Smtp-Source: AKy350bCTDHWb192R4vXOKWuAP7F7unP7X/6dQ7+3/+glTva3+F4XoW9VfCC/1fs1n/bTK3jaPzXlA== X-Received: by 2002:a05:600c:2059:b0:3ed:346d:4534 with SMTP id p25-20020a05600c205900b003ed346d4534mr4712348wmg.0.1680795508446; Thu, 06 Apr 2023 08:38:28 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003ee4e99a8f6sm1891760wmi.33.2023.04.06.08.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:38:27 -0700 (PDT) From: Jerome Neanne To: vigneshr@ti.com, bb@ti.com, jh80.chung@samsung.com, nm@ti.com, g-vlaev@ti.com, d-gerlach@ti.com, jpanis@baylibre.com, jneanne@baylibre.com, vaishnav.a@ti.com, michal.simek@amd.com, j-keerthy@ti.com Cc: u-boot@lists.denx.de, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, khilman@baylibre.com Subject: [PATCH v1 1/9] drivers: pmic: TPS65941 add support for WD disable Date: Thu, 6 Apr 2023 17:38:12 +0200 Message-Id: <20230406153820.2800054-2-jneanne@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406153820.2800054-1-jneanne@baylibre.com> References: <20230406153820.2800054-1-jneanne@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Apr 2023 19:41:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This is not a proper WD driver because it's not planned to support WD driver for PMIC in u-boot at any time. The purpose is just WD disable. Signed-off-by: Jerome Neanne --- drivers/power/pmic/tps65941.c | 36 +++++++++++++++++++++++++++++++++++ include/power/tps65941.h | 25 ++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/drivers/power/pmic/tps65941.c b/drivers/power/pmic/tps65941.c index 83d0f83c64..643ea6179c 100644 --- a/drivers/power/pmic/tps65941.c +++ b/drivers/power/pmic/tps65941.c @@ -47,6 +47,9 @@ static int tps65941_bind(struct udevice *dev) ofnode regulators_node; int children; + if (dev->driver_data == TPS65941_WD) + return 0; + regulators_node = dev_read_subnode(dev, "regulators"); if (!ofnode_valid(regulators_node)) { debug("%s: %s regulators subnode not found!\n", __func__, @@ -64,6 +67,36 @@ static int tps65941_bind(struct udevice *dev) return dm_scan_fdt_dev(dev); } +static int stop_watchdog(struct udevice *wd_i2c_dev) +{ + int ret; + + ret = dm_i2c_reg_read(wd_i2c_dev, TPS65941_WD_MODE_REG); + if (ret < 0) { + debug("failed to write i2c reg (%d)\n", ret); + return 0; + } + + ret &= ~TPS65941_WD_PWRHOLD_MASK; + ret |= TPS65941_WD_PWRHOLD_MASK; + ret = dm_i2c_reg_write(wd_i2c_dev, TPS65941_WD_MODE_REG, ret); + if (ret) + debug("%s: %s write WD disable fail!\n", __func__, wd_i2c_dev->name); + ret = dm_i2c_reg_read(wd_i2c_dev, TPS65941_WD_MODE_REG); + if (ret < 0) { + debug("failed to read back i2c reg (%d)\n", ret); + return 0; + } + return 0; +} + +static int tps65941_probe(struct udevice *dev) +{ + if (dev->driver_data == TPS65941_WD) + return stop_watchdog(dev); + return 0; +} + static struct dm_pmic_ops tps65941_ops = { .read = tps65941_read, .write = tps65941_write, @@ -73,7 +106,9 @@ static const struct udevice_id tps65941_ids[] = { { .compatible = "ti,tps659411", .data = TPS659411 }, { .compatible = "ti,tps659412", .data = TPS659411 }, { .compatible = "ti,tps659413", .data = TPS659413 }, + { .compatible = "ti,tps659312", .data = TPS659312 }, { .compatible = "ti,lp876441", .data = LP876441 }, + { .compatible = "ti,tps65941_watchdog", .data = TPS65941_WD }, { } }; @@ -82,5 +117,6 @@ U_BOOT_DRIVER(pmic_tps65941) = { .id = UCLASS_PMIC, .of_match = tps65941_ids, .bind = tps65941_bind, + .probe = tps65941_probe, .ops = &tps65941_ops, }; diff --git a/include/power/tps65941.h b/include/power/tps65941.h index a2bc6814ba..70c7274355 100644 --- a/include/power/tps65941.h +++ b/include/power/tps65941.h @@ -2,7 +2,9 @@ #define TPS659412 0x1 #define TPS659413 0x2 #define TPS659414 0x3 -#define LP876441 0x4 +#define TPS659312 0x4 +#define LP876441 0x5 +#define TPS65941_WD 0x20 /* I2C device address for pmic tps65941 */ #define TPS65941_I2C_ADDR (0x12 >> 1) @@ -18,10 +20,29 @@ #define TPS65941_BUCK_VOLT_MAX 3340000 #define TPS65941_BUCK_MODE_MASK 0x1 -#define TPS65941_LDO_VOLT_MASK 0x3E +#define TPS65941_LDO_VOLT_MASK 0x7F #define TPS65941_LDO_VOLT_MAX_HEX 0x3A #define TPS65941_LDO_VOLT_MIN_HEX 0x4 #define TPS65941_LDO_VOLT_MAX 3300000 #define TPS65941_LDO_MODE_MASK 0x1 #define TPS65941_LDO_BYPASS_EN 0x80 #define TP65941_BUCK_CONF_SLEW_MASK 0x7 + +/* BYPASS is bit7 of VOUT TPS65941_LDO_BYP_MASK */ +#define TPS65941_LDO123_BYP_CONFIG 7 + +#define TPS65941_LDO123_VOLT_BYP_MIN 1700000 +#define TPS65941_LDO123_VOLT_BYP_MAX 3600000 +#define TPS65941_LDO123_VOLT_MIN 600000 +#define TPS65941_LDO4_VOLT_MIN 1200000 +#define TPS65941_LDO4_VOLT_MIN 1200000 +#define TPS65941_LDO123_VSET_MIN 0x04 +#define TPS65941_LDO4_VSET_MIN 0x20 +#define TPS65941_LDO123_VSET_MAX 0x3A +#define TPS65941_LDO4_VSET_MAX 0x74 +#define TPS65941_LDO123_STEP 50000 +#define TPS65941_LDO4_STEP 25000 + +#define TPS65941_WD_MODE_REG 0x406 +#define TPS65941_WD_PWRHOLD_MASK BIT(2) + From patchwork Thu Apr 6 15:38:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 1766291 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=d8q/YWig; 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 4Psphp1cXvz1yYs for ; Fri, 7 Apr 2023 03:41:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6770D860A5; Thu, 6 Apr 2023 19:41:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="d8q/YWig"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3DC978606F; Thu, 6 Apr 2023 17:38:35 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (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 3ABA686070 for ; Thu, 6 Apr 2023 17:38:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jneanne@baylibre.com Received: by mail-wm1-x336.google.com with SMTP id m8so11902647wmq.5 for ; Thu, 06 Apr 2023 08:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680795510; x=1683387510; 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=H0MIrLgUMOIB6ZwjkpR5Wb9P3H030IuVOkYVdToN9QM=; b=d8q/YWig59F0TLFDTavlUjhuyxKWl+CWdSYHyd++iAWGKf349OzJ3LmUq9AvlVs9tf JRYI8qRqP5YQlnCx7zs9lRVJBa+64D8pUNgJ/XbhiR4PSOvHHU/EMckK7Jz6uBjikiLC gyfXdXH6puGcPY2cuS9povrJkTIxgNfTwZnDt3jgNCxuM7ayMY8mBecjj7bStc0BY3fP IZgc+lViJ6yOoqCfuTtpsrivzX89oitLJzPCzJFH9uQ6ONgqqshjzdnDPw0oXF2Ovyyh pbVjSVl9mQFgipJVQ5MjPVvIeXQA6gKRACNIEUaf02RuIYES8s1XImWOEPmeqMPLMwxS 0N8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795510; x=1683387510; 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=H0MIrLgUMOIB6ZwjkpR5Wb9P3H030IuVOkYVdToN9QM=; b=CpVAlFQyZCGrsKpVBCg9RWmDYJNFmdvQzNdbIM0k+epqvl43PTLl8EgDbugkrCRIcx Bvj9t6HpeWY0KYDxA0jCCkAqT8qfLb4uU1cI7p9ZNGN4KmoRFicTxYvbWpVgqfy4RuwC 1SNg5Bu1mjcGRPQvFo17TJ5USHTyArYQCq22v8fzFtj8Cj1oCXMtYL4qsIaw7DDhlLNO sc99Ub20RzngI+HycBOKiTNHDb8H3NKLW6Wz2lMA3VTJQtq33d8qLNgYMm5F6fvhoNgm Fqp2YHBRZyT9z4Ffo+Nn9gguzZSYuBP5Ygmd5bUfCD/itEb9mUFACZrW1VauBADYTeyA DKsA== X-Gm-Message-State: AAQBX9eowt+JCu7MvHrVnN9CRsXArFWtIm++OwzWVoJWlo8sPX0HRQel pzcUDereji+OLHjO+GLrlOvijg== X-Google-Smtp-Source: AKy350bw4+va9x9dXTQZnCwZ9zXnEdfzN06clSmZgvvUCLDw9eMvEmSvK5PTccW74+hVsugZA4zzWw== X-Received: by 2002:a7b:ce0e:0:b0:3dc:4b87:a570 with SMTP id m14-20020a7bce0e000000b003dc4b87a570mr7361100wmc.35.1680795510632; Thu, 06 Apr 2023 08:38:30 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003ee4e99a8f6sm1891760wmi.33.2023.04.06.08.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:38:30 -0700 (PDT) From: Jerome Neanne To: vigneshr@ti.com, bb@ti.com, jh80.chung@samsung.com, nm@ti.com, g-vlaev@ti.com, d-gerlach@ti.com, jpanis@baylibre.com, jneanne@baylibre.com, vaishnav.a@ti.com, michal.simek@amd.com, j-keerthy@ti.com Cc: u-boot@lists.denx.de, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, khilman@baylibre.com Subject: [PATCH v1 2/9] drivers: regulator: Fixes for TPS65941 LDO voltage conversion Date: Thu, 6 Apr 2023 17:38:13 +0200 Message-Id: <20230406153820.2800054-3-jneanne@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406153820.2800054-1-jneanne@baylibre.com> References: <20230406153820.2800054-1-jneanne@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Apr 2023 19:41:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Fixes: 065a452ae6a power: regulator: tps65941: add regulator support LDO voltage conversion was incorrect. This was checked by writing and reading back value. Signed-off-by: Jerome Neanne --- drivers/power/regulator/tps65941_regulator.c | 71 +++++++++++++++++--- 1 file changed, 63 insertions(+), 8 deletions(-) diff --git a/drivers/power/regulator/tps65941_regulator.c b/drivers/power/regulator/tps65941_regulator.c index b041126775..7afd68c5c4 100644 --- a/drivers/power/regulator/tps65941_regulator.c +++ b/drivers/power/regulator/tps65941_regulator.c @@ -212,12 +212,55 @@ static int tps65941_ldo_enable(struct udevice *dev, int op, bool *enable) return 0; } -static int tps65941_ldo_val2volt(int val) +static int tps65941_ldo_volt2val(int idx, int uV) { - if (val > TPS65941_LDO_VOLT_MAX_HEX || val < TPS65941_LDO_VOLT_MIN_HEX) + int base = TPS65941_LDO123_VOLT_MIN; + int max = TPS65941_LDO_VOLT_MAX; + int offset = TPS65941_LDO123_VSET_MIN; + int step = TPS65941_LDO123_STEP; + + if (idx > 2) { + base = TPS65941_LDO4_VOLT_MIN; + offset = TPS65941_LDO4_VSET_MIN; + step = TPS65941_LDO4_STEP; + } + + if (uV > max) return -EINVAL; - else if (val >= TPS65941_LDO_VOLT_MIN_HEX) - return 600000 + (val - TPS65941_LDO_VOLT_MIN_HEX) * 50000; + else if (uV >= base) + return (uV - base) / step + offset; + else + return -EINVAL; +} + +static int tps65941_ldo_val2volt(int idx, int val) +{ + int reg_base = TPS65941_LDO123_VSET_MIN; + int reg_max = TPS65941_LDO123_VSET_MAX; + int base = TPS65941_LDO123_VOLT_MIN; + int max = TPS65941_LDO_VOLT_MAX; + int step = TPS65941_LDO123_STEP; + int mask = TPS65941_LDO_VOLT_MASK >> 1; + + if (idx > 2) { + base = TPS65941_LDO4_VOLT_MIN; + max = TPS65941_LDO_VOLT_MAX; + reg_base = TPS65941_LDO4_VSET_MIN; + reg_max = TPS65941_LDO4_VSET_MAX; + step = TPS65941_LDO4_STEP; + mask = TPS65941_LDO_VOLT_MASK; + } else { + val = val >> 1; + } + + if (val > mask || val < 0) + return -EINVAL; + else if (val >= reg_max) + return max; + else if (val <= reg_base) + return base; + else if (val >= 0) + return base + (step * (val - reg_base)); else return -EINVAL; } @@ -227,7 +270,9 @@ static int tps65941_ldo_val(struct udevice *dev, int op, int *uV) unsigned int hex, adr; int ret; struct dm_regulator_uclass_plat *uc_pdata; + int idx; + idx = dev->driver_data - 1; uc_pdata = dev_get_uclass_plat(dev); if (op == PMIC_OP_GET) @@ -240,7 +285,8 @@ static int tps65941_ldo_val(struct udevice *dev, int op, int *uV) return ret; ret &= TPS65941_LDO_VOLT_MASK; - ret = tps65941_ldo_val2volt(ret); + ret = tps65941_ldo_val2volt(idx, ret); + if (ret < 0) return ret; @@ -249,12 +295,21 @@ static int tps65941_ldo_val(struct udevice *dev, int op, int *uV) return 0; } - hex = tps65941_buck_volt2val(*uV); + /* LDO1, LDO2 & LDO3 in BYPASS mode only supports 1.7V min to 3.6V max */ + if (idx < 2 && + (ret & BIT(TPS65941_LDO123_BYP_CONFIG)) && + *uV < TPS65941_LDO123_VOLT_BYP_MIN) + return -EINVAL; + + hex = tps65941_ldo_volt2val(idx, *uV); if (hex < 0) return hex; - ret &= 0x0; - ret = hex; + if (idx < 2) + hex = hex << 1; + + ret &= ~TPS65941_LDO_VOLT_MASK; + ret |= hex; ret = pmic_reg_write(dev->parent, adr, ret); From patchwork Thu Apr 6 15:38:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 1766292 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=Q9iqn7uf; 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 4Pspj36fxwz1yYs for ; Fri, 7 Apr 2023 03:41:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 21564860AF; Thu, 6 Apr 2023 19:41:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="Q9iqn7uf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3860386052; Thu, 6 Apr 2023 17:38:36 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 2FF4A86043 for ; Thu, 6 Apr 2023 17:38:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jneanne@baylibre.com Received: by mail-wm1-x32c.google.com with SMTP id n19-20020a05600c501300b003f064936c3eso3147378wmr.0 for ; Thu, 06 Apr 2023 08:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680795512; x=1683387512; 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=Bi3kbhVByzYo6c/HuvZIXjCOtXrlhrvxXSPIQxE1T2U=; b=Q9iqn7ufp7sWYssvodwLGv9iAJ+A2OmRx9h5DuHPDLABynrMb1yuYhL8NB9Qav0Chj WXBmdpEzXVF6i2R5vNWRYajkrTzkaalwbyzle6sKSn6I+hrGDFAef5EH/s19tSS8LDak tV+FRiPHKSfHjtbLKY+7NMC/Y47fszGg1r9YT5MjRlb6RIBaEWkxONGcHaobMfV/xT0o kykDlFAshCQeI0sh3pDbGR/gbjJOgpNPe0VFHEtKGYsOjbzEA/vfduZo7BwT77CHMyQM C8kO+FBxtYqJ+5CTToh/R1Q5p+J/Y2Ah/7hieAFOeWrXILwjmn2N/N2xpoFGxAu/sNFF y9wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795512; x=1683387512; 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=Bi3kbhVByzYo6c/HuvZIXjCOtXrlhrvxXSPIQxE1T2U=; b=DvluxnDy8fIV7kgeg1U9G9BleQzYg9QEoIlx4o+BoQlo+6iqlkPiIGx+OexaD20Wgp nY+v48UI+u46FbyBb9mUM2ak4Kg7ZEO1CBaKC35G2DKYskgQ8pkuR4VwoHB0SM0+eXHI jSXZKrnwfCE5A4LecLukkcN7jBa6zDDrqhtOa4RaVr7tbJDNupTz85TH+3decfIk6K5c rkP22kwmEqHWtrPrrsL5wFw4Ni+89Cz5NvAkTZJUbXPtuXX45EDGDw9kP6AOXuLQYeqE pPZuIS3VVEc8D0wS8VJoynCbOEsKoEJIHW2L2SJmcNfYerd6oiXgd/IpkXO/sFOSpEUB spSA== X-Gm-Message-State: AAQBX9eYYxxRKwtmiyIc5puBm8IuK08usmAWMEkPenCwQrtQ/1MOGNfi WGmTN716WbQdfMOW4Cxg2fw1Zg== X-Google-Smtp-Source: AKy350aRrsPC17WsNXkyt3HMngXUwDuCQKIxh+WWgFlRBWNewKRbgGFrNT7g1KQCejKVJo2vMRRYdw== X-Received: by 2002:a7b:cd0d:0:b0:3eb:2e32:72c3 with SMTP id f13-20020a7bcd0d000000b003eb2e3272c3mr8372411wmj.22.1680795512614; Thu, 06 Apr 2023 08:38:32 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003ee4e99a8f6sm1891760wmi.33.2023.04.06.08.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:38:32 -0700 (PDT) From: Jerome Neanne To: vigneshr@ti.com, bb@ti.com, jh80.chung@samsung.com, nm@ti.com, g-vlaev@ti.com, d-gerlach@ti.com, jpanis@baylibre.com, jneanne@baylibre.com, vaishnav.a@ti.com, michal.simek@amd.com, j-keerthy@ti.com Cc: u-boot@lists.denx.de, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, khilman@baylibre.com Subject: [PATCH v1 3/9] configs: j721e_evm: Add support for TPS65941 PMICs on j721e TI EVM board Date: Thu, 6 Apr 2023 17:38:14 +0200 Message-Id: <20230406153820.2800054-4-jneanne@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406153820.2800054-1-jneanne@baylibre.com> References: <20230406153820.2800054-1-jneanne@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Apr 2023 19:41:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add PMIC and regulators feature support for j721e. PMIC is controlled by SoC through I2C interface. Signed-off-by: Jerome Neanne --- configs/j721e_evm_a72_defconfig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig index 452e4b9695..7774330b60 100644 --- a/configs/j721e_evm_a72_defconfig +++ b/configs/j721e_evm_a72_defconfig @@ -77,6 +77,8 @@ CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y +CONFIG_CMD_PMIC=y +CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0,nor0=47034000.hyperbus" CONFIG_MTDPARTS_DEFAULT="mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),1m(ospi.sysfw),256k(ospi.env.backup),57344k@8m(ospi.rootfs),256k(ospi.phypattern);47034000.hyperbus:512k(hbmc.tiboot3),2m(hbmc.tispl),4m(hbmc.u-boot),256k(hbmc.env),1m(hbmc.sysfw),-@8m(hbmc.rootfs)" @@ -205,3 +207,10 @@ CONFIG_UFS=y CONFIG_CADENCE_UFS=y CONFIG_TI_J721E_UFS=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65941=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_TPS65941=y +CONFIG_CMD_DM=y +CONFIG_OF_PLATDATA=y + From patchwork Thu Apr 6 15:38:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 1766293 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=EznK+MQS; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PspjH6d63z1yYs for ; Fri, 7 Apr 2023 03:42:11 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E6183860D4; Thu, 6 Apr 2023 19:41:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="EznK+MQS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF1FE86077; Thu, 6 Apr 2023 17:38:37 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 3B7838606E for ; Thu, 6 Apr 2023 17:38:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jneanne@baylibre.com Received: by mail-wm1-x334.google.com with SMTP id n10-20020a05600c4f8a00b003ee93d2c914so25432165wmq.2 for ; Thu, 06 Apr 2023 08:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680795514; x=1683387514; 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=xafc/9mDFSuaS0t1r5pCG6rp2+7DJRezrGX5S+8UGgg=; b=EznK+MQSJHLuwqaKRJJdLrHwM0lVj4bQfWPTdXm7wmS13YAqjQ8owCCw2ANJCFwyiL OeO4Pydjh4IxBaBHdeVw2op+V/P/ildNN24EbUX053bpFfcNe/PxeZVoDKwkfTEFAaJt /aI2xet7v90tmir3Syk4fIX3H7gJhi9x29AC1VDj2Dn7gkw4qa0BJw16yKUSB0HQe5uQ 5JYSxFCnYIG5MoMRNCr27B9ZoWoINbMFxBFO9X2hgG3nb4EAzZghRUxEcbCRLHED3gYa ce9Vq2+TYTnGsnn9yAaqV5E8gnfd6a00GK8WKejxLs9ye91lDRfbZwhE26Gm2k8CjJep eUOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795514; x=1683387514; 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=xafc/9mDFSuaS0t1r5pCG6rp2+7DJRezrGX5S+8UGgg=; b=y5b9RM0wFRQgXy0rs0Y/LYpwwP9SY4ORjkYsYubYPFGGAp+9aw+HH1Fn0VRF+DgXMi aQA507ANY5jT2yYM9w+SEenveQhE0ukAJWbNJtQEMRXAmVeFxxXyuoyfk2KE02/RQfLf aCq0ULlQI7F6mcgVwAlEgmWd5OCv/UVL2l/D9JCbNGbLZLJ/Vk/3So7J6Re76YHUZOMj rO5d/OgvbanmOx5sqipW0mrALqXhTr3u+1jRea+8bzrJEeqoAN73fMJIn/2n5OoeZbLG z0MNx4IS3+Ulrawl0wYJlEJapBpcZscb8PDDBqfoMwRcA3nx1X0TXOquP9wLwtILD7Zh Wogg== X-Gm-Message-State: AAQBX9ePfvlJ81p/RKlacBtdBUngCPEfVV6dx/q+RKp87nd0fMZ1O4bg hyjTp1/L3nBPH0pxDQHZ9FZcWQ== X-Google-Smtp-Source: AKy350Yu0p0d0l9U5zjadaXauxxiYhwAsu6tPt0Yn/GoEEImH5RLGs1zlUJ4dh8qfZ7Kpb8mgsWcEA== X-Received: by 2002:a7b:ce16:0:b0:3ed:4b0f:5378 with SMTP id m22-20020a7bce16000000b003ed4b0f5378mr7566015wmc.27.1680795514731; Thu, 06 Apr 2023 08:38:34 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003ee4e99a8f6sm1891760wmi.33.2023.04.06.08.38.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:38:34 -0700 (PDT) From: Jerome Neanne To: vigneshr@ti.com, bb@ti.com, jh80.chung@samsung.com, nm@ti.com, g-vlaev@ti.com, d-gerlach@ti.com, jpanis@baylibre.com, jneanne@baylibre.com, vaishnav.a@ti.com, michal.simek@amd.com, j-keerthy@ti.com Cc: u-boot@lists.denx.de, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, khilman@baylibre.com Subject: [PATCH v1 4/9] board: ti: k3-j721e: Force TPS65941 PMIC WD disable on j721e TI EVM board Date: Thu, 6 Apr 2023 17:38:15 +0200 Message-Id: <20230406153820.2800054-5-jneanne@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406153820.2800054-1-jneanne@baylibre.com> References: <20230406153820.2800054-1-jneanne@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Apr 2023 19:41:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Using uclass_probe_all forces probe on all devices: Only probe for WD stop is really needed here. Probing other devices has no impact. Signed-off-by: Jerome Neanne --- board/ti/j721e/evm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index d4e672a7ac..a3304468d4 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -27,6 +27,8 @@ #include "../common/board_detect.h" +#include + #define board_is_j721e_som() (board_ti_k3_is("J721EX-PM1-SOM") || \ board_ti_k3_is("J721EX-PM2-SOM")) @@ -43,6 +45,12 @@ DECLARE_GLOBAL_DATA_PTR; int board_init(void) { + int ret; + + /* WD stop is applied unconditionally on all platforms*/ + ret = uclass_probe_all(UCLASS_PMIC); + if (ret) + printf("Failed to probe! stop tps65941 wd\n"); return 0; } From patchwork Thu Apr 6 15:38:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 1766294 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=oMO2iYMo; 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 4PspjV4ssMz1yYs for ; Fri, 7 Apr 2023 03:42:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 785F78215F; Thu, 6 Apr 2023 19:41:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="oMO2iYMo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C597E8607F; Thu, 6 Apr 2023 17:38:40 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (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 8563386052 for ; Thu, 6 Apr 2023 17:38:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jneanne@baylibre.com Received: by mail-wm1-x336.google.com with SMTP id v14-20020a05600c470e00b003f06520825fso3108607wmo.0 for ; Thu, 06 Apr 2023 08:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680795517; x=1683387517; 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=YOIyG+qgvRF5fb5GqJrHxKUeXpzmve73OoQh4seBqDI=; b=oMO2iYMoLEUx2ldWaZ5Ir20X1YcRrM9YsaL6WN2/ylBPRolj+BRH+OOqD3yH72fpDd ijFD8mckz+C22KyKs4IpkuxcEkx6KMkFwXtb5nMxHd08Gc3M+UTSZad0DGFLPlKA+ZTc Uvkr2qyRecSTS7iXDdbzNmYB18kzuSDDgSHoD41CabusDa0eIpM0j8YT6+zYVN40nZeQ j8H46lsgtINtVEdwDzvoV+WYDCGgHDrs6DyS6LL8if/4epTmEDSK4BSmn/Wee5E1lyte K9aG/0mPhU/Z2k5T+dyqTjjyg3PD1P4kxMh6oahTZBRbSGYOa205hjupWTHj2EaaOLf+ yUdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795517; x=1683387517; 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=YOIyG+qgvRF5fb5GqJrHxKUeXpzmve73OoQh4seBqDI=; b=nApso5IMWFy/WG3PjzxnfalnEQJot+0+yzoiCLCp1XdHRazW6JvxLe6POreEiv6PHp 2iTeiTGsAn5MxgvxHyunWhlP+FmYqdZz4dpZOHSp1BLSx2zYjb/IfsxiqKWfXsIwD5J8 ZEreAl/Py1DeaZKNtAvl0+koz/PM+qy2UkHG/zNiHFsinbVHOKFm0xjbib8UjUtADR0Y UsqUhjLdgNcyu66L5QMp2LaA21MULhu+/AsrfvOjP4mR5UVNWh54JAPwMTExHjyw5u0O FcHSXggiws7a2gT9/QixDEorX2/mYtI5nTxLyimf7k1Dc1UuP3HUxr/ArJwrIV6QeWO2 dqwA== X-Gm-Message-State: AAQBX9eTFbMD/qMmHwtD/moLap6DTD6Ea5cL8zOdREjJc2o8fG8wh56H Qc29PMvyzeCvLTpV0UqQ2iBNtg== X-Google-Smtp-Source: AKy350bPk79yPKbCsT4pSqhXWYv+rMhRzupK6I7cxJNIu2Jai0KxjlXA/rfqIrtIc59ZqYXbQhCnvA== X-Received: by 2002:a05:600c:ad2:b0:3dc:5b88:e6dd with SMTP id c18-20020a05600c0ad200b003dc5b88e6ddmr7687623wmr.10.1680795516935; Thu, 06 Apr 2023 08:38:36 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003ee4e99a8f6sm1891760wmi.33.2023.04.06.08.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:38:36 -0700 (PDT) From: Jerome Neanne To: vigneshr@ti.com, bb@ti.com, jh80.chung@samsung.com, nm@ti.com, g-vlaev@ti.com, d-gerlach@ti.com, jpanis@baylibre.com, jneanne@baylibre.com, vaishnav.a@ti.com, michal.simek@amd.com, j-keerthy@ti.com Cc: u-boot@lists.denx.de, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, khilman@baylibre.com Subject: [PATCH v1 5/9] DONOTMERGE: arm: dts: k3-j721e: u-boot overlay for TI tps6594 PMIC Date: Thu, 6 Apr 2023 17:38:16 +0200 Message-Id: <20230406153820.2800054-6-jneanne@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406153820.2800054-1-jneanne@baylibre.com> References: <20230406153820.2800054-1-jneanne@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Apr 2023 19:41:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean j721e board includes 2 instances of TPS6594: - Primary PMIC - Secondary PMIC Add AVS class0 in u-boot SPL. AVS is supported only on CPU rail: vdd_cpu_avs. This rail is supplied by the primary PMIC: tps659413 This rail is supplied by a dual-phased buck: buck12. Other PMICs rails are not AVS capable. Each PMIC includes a Watchdog that is active by default at boot. This would issue a platform reset unless pmic GPIO8 is driven or this is handled by SW. Watchdog driver is not required for identified use of this product. This software disable inside u-boot avoids parasitic wd reset. GPIO8 can then be used for other purpose. Board documentation: Link: https://www.ti.com/tool/J721EXSOMXEVM Signed-off-by: Jerome Neanne --- .../k3-j721e-common-proc-board-u-boot.dtsi | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi index b2b81f804d..d05d3610ff 100644 --- a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi @@ -79,6 +79,14 @@ chipid@43000014 { u-boot,dm-spl; }; + + mcu_i2c0: i2c@40b00000 { + status = "okay"; + tps65941_wd: tps65941-wd@12 { + compatible = "ti,tps65941_watchdog"; + reg = <0x12>; + }; + }; }; &secure_proxy_main { @@ -170,6 +178,19 @@ &wkup_i2c0 { u-boot,dm-spl; + tps659413: tps659413@48 { + u-boot,dm-spl; + compatible = "ti,tps659413"; + + regulators { + u-boot,dm-spl; + bucka12_reg: buck12 { + }; + }; + }; + tps659411: tps659411@4c { + compatible = "ti,tps659411"; + }; }; &main_i2c0 { From patchwork Thu Apr 6 15:38:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 1766295 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=6ROZm106; 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 4Pspjk5GGfz1yYs for ; Fri, 7 Apr 2023 03:42:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1C0B786020; Thu, 6 Apr 2023 19:41:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="6ROZm106"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A12386077; Thu, 6 Apr 2023 17:38:43 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 98FB486070 for ; Thu, 6 Apr 2023 17:38:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jneanne@baylibre.com Received: by mail-wm1-x32c.google.com with SMTP id n19so22821708wms.0 for ; Thu, 06 Apr 2023 08:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680795519; x=1683387519; 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=ZN+LiEKovu7OlJ1P9WGeUVf+OXtzjK+J4scEIawmsiI=; b=6ROZm106nF51mxG2FfHZvsSQuBIqyYr54hO6NPa0VAxZYMScrlhbyUYSQWlJmS0VvT lJkk7X+l7B6wKTSJU1FRkvNS95KYVCToAD/tnZD9wSkuTlh6VyVBlzaa5ukltzw66oOQ a6kzE53dzNts+FhM0J7Cxpdrnp1V6bU/YbxDCHqqUdBY/g7gQLChyqQ0VTflD5Iwtt/g v5ZBTksUxFBkFFZFe6fPVCIx+Y9Tm3GB63uYSUnSQsEf874tWxP6Q+dI0nFdgHqf2Efk TSylDLSz2SSVb4/V3mqHGMeJM1tvxoETeBA59qDCg6A9kTmatzM0XZu38Z9FxlbSW86s 4UaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795519; x=1683387519; 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=ZN+LiEKovu7OlJ1P9WGeUVf+OXtzjK+J4scEIawmsiI=; b=ZfADrNdANdETgx9kcLdxYt0vkbvYBl7f+gJLNzSLJJFVO1KVdzCWboOVez2dO+1NTY jp3qR5anVJZ5qELspe0cWYDWgw6mf6Ud4mb3G43tDgJz8Xs6WFVjGACPlAThp4TUzKr/ 8aFQGS7YkEA9P9bRt0QDfxNKTbgusHdcsgcZuNvdQhRNcoFuLH1o9d92g+CNV0o4CxAJ onOeQQO6wWF9VDgoGUhhvxWk2110D8YQIJzOb7JQQxW+0fVOx7uotMBqxO2XufWuBUXY msODRnjC2u2Fvng60t07WxeLVcHNf3JoGhbVfPKSt/ENl6rZCiPiFXNCMgZG2yO0i0+s YSrA== X-Gm-Message-State: AAQBX9foX4d4Wrp/KyOJx+H/EE9hUa402TzxRn1hPjM1EU5ANmrU203n 1ZemB2koV5LJB4FnXW5knamJKA== X-Google-Smtp-Source: AKy350b9wGChk78/2vwYFwXfcsgz06TB9O2jTEnGnJPKq1alTxi/imzOLeaHI4CTzf5KsaJYGFbVsg== X-Received: by 2002:a7b:c4c6:0:b0:3eb:3945:d3fd with SMTP id g6-20020a7bc4c6000000b003eb3945d3fdmr7693084wmk.14.1680795519126; Thu, 06 Apr 2023 08:38:39 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003ee4e99a8f6sm1891760wmi.33.2023.04.06.08.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:38:38 -0700 (PDT) From: Jerome Neanne To: vigneshr@ti.com, bb@ti.com, jh80.chung@samsung.com, nm@ti.com, g-vlaev@ti.com, d-gerlach@ti.com, jpanis@baylibre.com, jneanne@baylibre.com, vaishnav.a@ti.com, michal.simek@amd.com, j-keerthy@ti.com Cc: u-boot@lists.denx.de, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, khilman@baylibre.com Subject: [PATCH v1 6/9] DONOTMERGE: arm: dts: k3-j721e: refactor r5 board file to use Linux dts tps6594 description Date: Thu, 6 Apr 2023 17:38:17 +0200 Message-Id: <20230406153820.2800054-7-jneanne@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406153820.2800054-1-jneanne@baylibre.com> References: <20230406153820.2800054-1-jneanne@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Apr 2023 19:41:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Use a copy of Linux dts for TPS6594 PMIC description instead of custom u-boot Signed-off-by: Jerome Neanne --- .../arm/dts/k3-j721e-r5-common-proc-board.dts | 48 +++++++++---------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/arch/arm/dts/k3-j721e-r5-common-proc-board.dts b/arch/arm/dts/k3-j721e-r5-common-proc-board.dts index ab9d6e65d8..a5c0222e91 100644 --- a/arch/arm/dts/k3-j721e-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j721e-r5-common-proc-board.dts @@ -21,6 +21,27 @@ tick-timer = &timer1; }; + evm_12v0: fixedregulator-evm12v0 { + /* main supply */ + compatible = "regulator-fixed"; + regulator-name = "evm_12v0"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + regulator-always-on; + regulator-boot-on; + }; + + vsys_3v3: fixedregulator-vsys3v3 { + /* Output of LM5140 */ + compatible = "regulator-fixed"; + regulator-name = "vsys_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&evm_12v0>; + regulator-always-on; + regulator-boot-on; + }; + a72_0: a72@0 { compatible = "ti,am654-rproc"; reg = <0x0 0x00a90000 0x0 0x10>; @@ -276,33 +297,8 @@ ti,driver-strength-ohm = <50>; }; -&wkup_i2c0 { - u-boot,dm-spl; - tps659413a: tps659413a@48 { - reg = <0x48>; - compatible = "ti,tps659413"; - u-boot,dm-spl; - pinctrl-names = "default"; - pinctrl-0 = <&wkup_i2c0_pins_default>; - clock-frequency = <400000>; - - regulators: regulators { - u-boot,dm-spl; - buck12_reg: buck12 { - /*VDD_CPU*/ - regulator-name = "buck12"; - regulator-min-microvolt = <600000>; - regulator-max-microvolt = <900000>; - regulator-always-on; - regulator-boot-on; - u-boot,dm-spl; - }; - }; - }; -}; - &wkup_vtm0 { - vdd-supply-2 = <&buck12_reg>; + vdd-supply-2 = <&bucka12_reg>; u-boot,dm-spl; }; From patchwork Thu Apr 6 15:38:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 1766296 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=lWk24wv5; 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 4Pspjy5kh2z1yYs for ; Fri, 7 Apr 2023 03:42:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 75963860EF; Thu, 6 Apr 2023 19:41:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="lWk24wv5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E7FF686073; Thu, 6 Apr 2023 17:38:44 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 C9C4F86052 for ; Thu, 6 Apr 2023 17:38:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jneanne@baylibre.com Received: by mail-wm1-x329.google.com with SMTP id v6-20020a05600c470600b003f034269c96so13715811wmo.4 for ; Thu, 06 Apr 2023 08:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680795521; x=1683387521; 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=jYtgPOtjD0XBzRwwsCxaFWEDwuoXcI24QzE4CgoFNuk=; b=lWk24wv5eCU2gKY2DnwUz5zgwA8c/+aus5Ur+ub/bwKO/eAK62Gr7V5ZSYnkAt016Z aaN1aPjlXs1HLpPxiLwJirnhl20WKJhVJX5p15Ir6266pW3OQJKR+wyYWuuqoMbxYExc nMA5+sZaqsE5Og01yFwyxEpd6TVJShNqE91RxKvXpwZeaQ//+JebsOTOK+8lCwhWzzdL 5d6pBFghSiuo/VnSq13ISrbUKAqjHuc+PP/zyGDtXdg3e9YC88b8E3GpnYpIBPPvCiQZ fi+wNbpTW8Abu+PzTR78/RQzgI6ZchAuUobDZmoC0UhuB4gXkRDe2H41Zf3qS71iywFj bBhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795521; x=1683387521; 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=jYtgPOtjD0XBzRwwsCxaFWEDwuoXcI24QzE4CgoFNuk=; b=SBlGPCjlhu1rCPly0WABIQgRPXe34rOFWYUaBEGMSUYatjOxppC1OUtKUvukT5mNoI rl3V6yNxX/JcmXnh3CkyUDoKsSdbtvGfkhY21ztTSzQ+CY7Azi5NatAyCeqCNxvrbWY3 y5ROqyxXUYnq/phhtzVvC7BU3ND9w5WyT4PHUSbD4Wv+F/bjNelG8OMPTnjzNVX5o/Rs GiIQkyaa73EuH5txMAZwuYZvDQ9noRW6kDYLWp0wLMO6bOqQmUz/WR2LldDWmCAWMFA/ 60SrGSQFTQsTFP6eZ4HoKnp9YDuVhq4FVx3EE4b/iGvud96YbZaP0E3OxH0sT9EOhex4 DGNA== X-Gm-Message-State: AAQBX9dz6F0Ojkv5B5B3N9KobczDChoPfavK1NaKAQfFlkgjUDr1drr6 8T4WkMFG8LdPovEpVfols5xLlQ== X-Google-Smtp-Source: AKy350YIkFcPc5W8BSK5h5Wo589dSswtkjyJ6eDY9OcZxAdHVfeS/dquHWj3cn4uoEFfsB1FNVdWsw== X-Received: by 2002:a05:600c:259:b0:3ed:2a8f:e6dd with SMTP id 25-20020a05600c025900b003ed2a8fe6ddmr7392980wmj.6.1680795521262; Thu, 06 Apr 2023 08:38:41 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003ee4e99a8f6sm1891760wmi.33.2023.04.06.08.38.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:38:40 -0700 (PDT) From: Jerome Neanne To: vigneshr@ti.com, bb@ti.com, jh80.chung@samsung.com, nm@ti.com, g-vlaev@ti.com, d-gerlach@ti.com, jpanis@baylibre.com, jneanne@baylibre.com, vaishnav.a@ti.com, michal.simek@amd.com, j-keerthy@ti.com Cc: u-boot@lists.denx.de, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, khilman@baylibre.com Subject: [PATCH v1 7/9] DONOTMERGE: arm: dts: k3-j721e: realign node name on linux dts name Date: Thu, 6 Apr 2023 17:38:18 +0200 Message-Id: <20230406153820.2800054-8-jneanne@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406153820.2800054-1-jneanne@baylibre.com> References: <20230406153820.2800054-1-jneanne@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Apr 2023 19:41:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Change node name to reuse Linux common dts naming style. Signed-off-by: Jerome Neanne --- arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi index 48c6ddf672..206f8560f9 100644 --- a/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi @@ -21,7 +21,7 @@ }; }; -&tps659413a { +&tps659413 { esm: esm { compatible = "ti,tps659413-esm"; u-boot,dm-spl; From patchwork Thu Apr 6 15:38:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 1766297 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=UqIb1BEo; 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 4Pspk958hBz1yYs for ; Fri, 7 Apr 2023 03:42:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 94BB6860E9; Thu, 6 Apr 2023 19:41:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="UqIb1BEo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A0BF986052; Thu, 6 Apr 2023 17:38:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 0572586043 for ; Thu, 6 Apr 2023 17:38:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jneanne@baylibre.com Received: by mail-wm1-x32d.google.com with SMTP id j18-20020a05600c1c1200b003ee5157346cso25764564wms.1 for ; Thu, 06 Apr 2023 08:38:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680795523; x=1683387523; 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=Z8TX7vUgl5byBg6B6QVCK8bYN6HEnJSgWl0yRBjTmoo=; b=UqIb1BEol+eFB3pK18f3ScFTuGTRUfsmi9AQrgL+bCwn9YL/Y0o4whgYA3Fde6NaVJ wLIsSerBwUQIzx3sCdZDZi7Q4RytLY83RZIIpzVbNOa64trfjxLuKC/uqS0px5rhd+qZ rNELot2odw2GTasw7RRx/RzSABHM4wajBeih1tvFKh5N1vMCchumuIk+fDGWrQzvQr/z 39e3B14XqX8K/6ka0sUqdKo/VwlW1AdAv/59u2w9IwF8KJA9neyog350Zutsh3EGvWGO osZIvs7eLM4MB0DG9FX0Cv+nVrDmN8tU8KX+pnSQOW3c4BgehfeZMd8zkpszxFQp5Zwi bMtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795523; x=1683387523; 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=Z8TX7vUgl5byBg6B6QVCK8bYN6HEnJSgWl0yRBjTmoo=; b=KHRwiLKHO3RMvIU8LBFq7c00/EyCCVuF271G3z20rjXPxOrTwEltpxZOyU9WVL6Dds cK2d8tnijxGugtq0AjMjHNuTzMnesKs8M9nrlc+saFOYfAFz81lvoy8q1QzlK5DM0TvE jXMlRTq1e6VeJNIIO6wIEJ4EFKW2cil+svOByTEcNhvnLx489DVUdQEpBnzbXl/LSByo Tdja5bYJF1l+8VQsG48ATqEhe9+f+BeQievuHDdE9tXcuKjqZbvzfBtK13wcbU7tU7+q dqZRaMf3onDhaAkUXBihfn4WMvHVP40cd+YQjeTiT7mzTJfSw1Szfr100o4JKO98M6q2 p0RA== X-Gm-Message-State: AAQBX9cBnoMUW5+valCcZX7/tcu5eLyiOhUPcYhQ33nAaYHCiE9YUr5c T5fTrgjkpT2r/37+6LbPjqq12Q== X-Google-Smtp-Source: AKy350bxbxQPjAjwfYh7DwsPKz5sTIrEv9lHSxBIUjyX/9fd72uSbWXkgxxv8DQvLveY3ZzzODRBuA== X-Received: by 2002:a05:600c:2216:b0:3e2:1dac:b071 with SMTP id z22-20020a05600c221600b003e21dacb071mr4641461wml.13.1680795523388; Thu, 06 Apr 2023 08:38:43 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003ee4e99a8f6sm1891760wmi.33.2023.04.06.08.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:38:42 -0700 (PDT) From: Jerome Neanne To: vigneshr@ti.com, bb@ti.com, jh80.chung@samsung.com, nm@ti.com, g-vlaev@ti.com, d-gerlach@ti.com, jpanis@baylibre.com, jneanne@baylibre.com, vaishnav.a@ti.com, michal.simek@amd.com, j-keerthy@ti.com Cc: u-boot@lists.denx.de, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, khilman@baylibre.com Subject: [PATCH v1 8/9] configs: am62ax_evm_a53: Enable support for TI TPS6593 PMIC Date: Thu, 6 Apr 2023 17:38:19 +0200 Message-Id: <20230406153820.2800054-9-jneanne@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406153820.2800054-1-jneanne@baylibre.com> References: <20230406153820.2800054-1-jneanne@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Apr 2023 19:41:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Julien Panis Add support for TPS6593 regulators and watchdog. PMIC is controlled by SoC through I2C interface. Signed-off-by: Julien Panis Signed-off-by: Jerome Neanne --- configs/am62ax_evm_a53_defconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configs/am62ax_evm_a53_defconfig b/configs/am62ax_evm_a53_defconfig index 8b48f5e8e6..358271204a 100644 --- a/configs/am62ax_evm_a53_defconfig +++ b/configs/am62ax_evm_a53_defconfig @@ -50,7 +50,6 @@ CONFIG_SPL_CLK=y CONFIG_CLK_TI_SCI=y CONFIG_TI_SCI_PROTOCOL=y # CONFIG_GPIO is not set -# CONFIG_I2C is not set CONFIG_DM_MAILBOX=y CONFIG_K3_SEC_PROXY=y CONFIG_MMC_SDHCI=y @@ -74,3 +73,11 @@ CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_TI_SCI=y CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65941=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_TPS65941=y +CONFIG_DM_I2C=y +CONFIG_I2C=y +CONFIG_SPL_I2C=y +CONFIG_SYS_I2C_OMAP24XX=y From patchwork Thu Apr 6 15:38:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 1766298 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=HW0z2AA+; 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 4PspkP0n6lz1yYs for ; Fri, 7 Apr 2023 03:43:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2B90E8611C; Thu, 6 Apr 2023 19:41:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com 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=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="HW0z2AA+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 537AA86052; Thu, 6 Apr 2023 17:38:48 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 9C2548606F for ; Thu, 6 Apr 2023 17:38:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jneanne@baylibre.com Received: by mail-wm1-x334.google.com with SMTP id n10-20020a05600c4f8a00b003ee93d2c914so25432475wmq.2 for ; Thu, 06 Apr 2023 08:38:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680795525; x=1683387525; 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=wqIwg4dDDA1sZ9lxbEW8l4gryer1So4n6TfvHvlR2/8=; b=HW0z2AA+ppsJ33BR6aQpe97FJnuFjyDmCCqDJbzKV+ajUyq2KIUxCXC9VVgHRyVJbP D23wLUoTx/yw4LCEca/Vj0RowJu0UcecbrpvZNVVG+0oTx5gyfhqcQb1p3YNld/ntn5T GtpdPUeD2TpeqgJbIjex5jqGmnblt4qA6OJ29UF7iNq0gpAaKLxbCYTTGGXaSJWR9a/P aKYC74+JZuCT9j/Kb5qCYZdzYxAkCx0bwQF7t3UEjbJ1POe5iOGTwTElDm1aDw40VLZz 8VAP88lI7LPEtB2jJGbZ82sG9IdsI/IZmyGW0e9ErIFgnoOBOjN3CRgK3yJSXedKvd/P vNaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680795525; x=1683387525; 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=wqIwg4dDDA1sZ9lxbEW8l4gryer1So4n6TfvHvlR2/8=; b=7fZyHlS9k0IKjm+B3LYw4jm2L8fZi3doKegSY2U1aa1eDrYcbatKKM6eEkSe6igcoj qEOi/fXqSbm4mns8HxxZTjBl+b2BzhcCRLR+C5aLSswDE6tN6OYfZVmgmMDQcv3o/MZU /8CeQcWKuUSF5M70hq1oR3vIwnC7SASIC4AMF/rhsemWpYQKc2UR7af3Son8aWJaKKxa 5u99Ytz/bzFjH1MqQpg5agApL+OcmDZCwNJEF3MCyPDRUVm35mRW1P2CERaRjsIPe+jZ 5fIQNwEaqNRzCW9dX6WAy2m5DHNaQqqTMbInV7NDFg205nLeDwqihYabobgJlIfGL+M+ 8z+w== X-Gm-Message-State: AAQBX9dHpuOUDGUe0HILKso2EYYjPz2SnmKxZLz2hquRU2eORLwIOsIx zLQxs1DmqeLYx/xsqcYNAhNTOQ== X-Google-Smtp-Source: AKy350aTo4ofrg4zfbpPyFZMmehXjbZzaCrBEdc+kTsLblL6UZaw57mIzY3R/rJ4++U2PfmDXAjftw== X-Received: by 2002:a05:600c:3b93:b0:3ed:2346:44bd with SMTP id n19-20020a05600c3b9300b003ed234644bdmr4608838wms.19.1680795525386; Thu, 06 Apr 2023 08:38:45 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003ee4e99a8f6sm1891760wmi.33.2023.04.06.08.38.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:38:45 -0700 (PDT) From: Jerome Neanne To: vigneshr@ti.com, bb@ti.com, jh80.chung@samsung.com, nm@ti.com, g-vlaev@ti.com, d-gerlach@ti.com, jpanis@baylibre.com, jneanne@baylibre.com, vaishnav.a@ti.com, michal.simek@amd.com, j-keerthy@ti.com Cc: u-boot@lists.denx.de, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, khilman@baylibre.com Subject: [PATCH v1 9/9] DONOTMERGE: arm: dts: k3-am62a7-sk: Add TI TPS6593 PMIC support Date: Thu, 6 Apr 2023 17:38:20 +0200 Message-Id: <20230406153820.2800054-10-jneanne@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406153820.2800054-1-jneanne@baylibre.com> References: <20230406153820.2800054-1-jneanne@baylibre.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 06 Apr 2023 19:41:06 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add support for TPS6593 PMIC devices: - regulators (bucks and LDOs) on main I2C0 bus, - watchdog on MCU I2C0 bus. Signed-off-by: Julien Panis Signed-off-by: Jerome Neanne --- arch/arm/dts/k3-am62a7-sk-u-boot.dtsi | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi b/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi index 7fc749ed70..4b2e9f7d22 100644 --- a/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi @@ -84,7 +84,14 @@ }; &mcu_pmx0 { - u-boot,dm-spl; + status = "okay"; + + mcu_i2c0_pins_default: mcu_i2c0_pins_default { + pinctrl-single,pins = < + AM62X_MCU_IOPAD(0x044, PIN_INPUT_PULLUP, 0) /* (E12) MCU_I2C0_SCL */ + AM62X_MCU_IOPAD(0x048, PIN_INPUT_PULLUP, 0) /* (D9) MCU_I2C0_SDA */ + >; + }; }; &wkup_uart0 { @@ -96,7 +103,20 @@ }; &main_i2c0 { - u-boot,dm-spl; + tps659312: tps659312@48 { + compatible = "ti,tps659312"; + }; +}; + +&mcu_i2c0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&mcu_i2c0_pins_default>; + + tps65931_wd: tps65931_wd@12 { + compatible = "ti,tps65941_watchdog"; + reg = <0x12>; + }; }; &main_i2c0_pins_default {