U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dominik Haller <d.haller@phytec.de>
To: Dominik Haller <d.haller@phytec.de>, Tom Rini <trini@konsulko.com>
Cc: <upstream@lists.phytec.de>, <u-boot@lists.denx.de>
Subject: [PATCH 2/2] board: phytec: phycore_am68x: Turn off pmic watchdog
Date: Wed, 15 Jul 2026 16:17:40 -0700	[thread overview]
Message-ID: <20260715231742.56105-2-d.haller@phytec.de> (raw)
In-Reply-To: <20260715231742.56105-1-d.haller@phytec.de>

Starting with pmic firmware version 5 the watchdog is enabled with a
timeout window of 13 minutes by default.

The TI EVMs use a dip switch to control a gpio on the pmic which gets
configured as DISABLE_WDOG by the firmware.
On the phycore_am68x there is no such dip switch so pull resistors would be
necessary. Using mcu_i2c0 to turn off the pmic watchdog works with all
hardware and pmic firmware combinations.

Signed-off-by: Dominik Haller <d.haller@phytec.de>
---
 board/phytec/phycore_am68x/phycore-am68x.c | 41 ++++++++++++++++++++++
 configs/phycore_am68x_a72_defconfig        |  1 -
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/board/phytec/phycore_am68x/phycore-am68x.c b/board/phytec/phycore_am68x/phycore-am68x.c
index 312d7ece23e2..9b71a4bdc680 100644
--- a/board/phytec/phycore_am68x/phycore-am68x.c
+++ b/board/phytec/phycore_am68x/phycore-am68x.c
@@ -21,6 +21,7 @@
 #include <dm/uclass-internal.h>
 #include <dm/root.h>
 #include <asm/arch/k3-ddr.h>
+#include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -69,6 +70,46 @@ void spl_perform_board_fixups(struct spl_image_info *spl_image)
 }
 #endif
 
+#define TPS6594_I2C_WD_ADDR	0x12
+#define WD_THR_CFG_REG		0x09
+#define WD_EN			BIT(6)
+
+int tps6594_disable_watchdog(void)
+{
+	struct udevice *i2c_bus, *i2c_dev;
+	int ret;
+	u8 val;
+
+	ret = uclass_get_device_by_name(UCLASS_I2C, "i2c@40b00000", &i2c_bus);
+	if (ret)
+		return ret;
+
+	ret = dm_i2c_probe(i2c_bus, TPS6594_I2C_WD_ADDR, 0, &i2c_dev);
+	if (ret)
+		return ret;
+
+	ret = dm_i2c_reg_read(i2c_dev, WD_THR_CFG_REG);
+	if (ret < 0)
+		return ret;
+
+	val = (u8)ret;
+	val &= ~WD_EN;
+	ret = dm_i2c_reg_write(i2c_dev, WD_THR_CFG_REG, val);
+
+	return ret;
+}
+
+int board_init(void)
+{
+	int ret;
+
+	ret = tps6594_disable_watchdog();
+	if (ret)
+		printf("disabling TPS6594 watchdog failed: %d\n", ret);
+
+	return 0;
+}
+
 void spl_board_init(void)
 {
 	struct udevice *dev;
diff --git a/configs/phycore_am68x_a72_defconfig b/configs/phycore_am68x_a72_defconfig
index 5ede3eb73e7f..e74e604e1bc7 100644
--- a/configs/phycore_am68x_a72_defconfig
+++ b/configs/phycore_am68x_a72_defconfig
@@ -38,7 +38,6 @@ CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOOTCOMMAND="bootflow scan -lb; run ${boot}boot"
 CONFIG_DEFAULT_FDT_FILE="oftree"
 CONFIG_LOGLEVEL=7
-# CONFIG_BOARD_INIT is not set
 CONFIG_SPL_MAX_SIZE=0xc0000
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-- 
2.43.0


      reply	other threads:[~2026-07-15 23:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 23:17 [PATCH 1/2] arm: dts: k3-am68-phyboard-izar-u-boot: Add mcu_i2c0 Dominik Haller
2026-07-15 23:17 ` Dominik Haller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260715231742.56105-2-d.haller@phytec.de \
    --to=d.haller@phytec.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=upstream@lists.phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox