diff options
| author | Dominik Haller <[email protected]> | 2026-07-15 16:17:40 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-07-28 12:30:55 -0600 |
| commit | cecee552a732500cf822c94014fdc56fddd1af4e (patch) | |
| tree | dd7f53c425f9a6aa2f1c827b486da4c9d6a27521 /board | |
| parent | 1efe750e728e18fb37c1705d4ec3f6176ca3d9d5 (diff) | |
board: phytec: phycore_am68x: Turn off pmic watchdog
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 <[email protected]>
Diffstat (limited to 'board')
| -rw-r--r-- | board/phytec/phycore_am68x/phycore-am68x.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/board/phytec/phycore_am68x/phycore-am68x.c b/board/phytec/phycore_am68x/phycore-am68x.c index 312d7ece23e..9b71a4bdc68 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; |
