From b187aebc66f6f8290fec5add75a8f9671c9c47d5 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Mon, 20 Feb 2023 23:15:45 +0100 Subject: board: toradex: verdin-am62: set pmic buck1 +vdd_core to 850 mV Set PMIC Buck1 aka +VDD_CORE to 850 mV as required to operate the AM625 at its highest operating point of 1.4 GHz. Upstream-Status: Pending Initial U-Boot to be used for bring-up and validation of the V1.0 design, we'll decide on the step forward to mainline this once the bring-up and validation will be done. Signed-off-by: Marcel Ziswiler --- board/toradex/verdin-am62/verdin-am62.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/board/toradex/verdin-am62/verdin-am62.c b/board/toradex/verdin-am62/verdin-am62.c index e98d711f6a..7116bd82bc 100644 --- a/board/toradex/verdin-am62/verdin-am62.c +++ b/board/toradex/verdin-am62/verdin-am62.c @@ -13,15 +13,41 @@ #include #include #include +#include #include +#include #include #include "../common/tdx-cfg-block.h" DECLARE_GLOBAL_DATA_PTR; +#define PMIC_I2C_BUS 0x0 +#define PMIC_I2C_ADDRESS 0x30 +#define PMIC_BUCK1_VSET_850 0xa + int board_init(void) { + struct udevice *dev; + u8 addr, data[1]; + int err; + + /* Set PMIC Buck1 aka +VDD_CORE to 850 mV */ + err = i2c_get_chip_for_busnum(PMIC_I2C_BUS, PMIC_I2C_ADDRESS, 1, &dev); + if (err) { + printf("%s: Cannot find PMIC I2C chip (err=%d)\n", __func__, err); + } else { + addr = TPS65219_BUCK1_VOUT_REG; + err = dm_i2c_read(dev, addr, data, 1); + if (err) + debug("failed to get TPS65219_BUCK1_VOUT_REG (err=%d)\n", err); + data[0] &= ~TPS65219_VOLT_MASK; + data[0] |= PMIC_BUCK1_VSET_850; + err = dm_i2c_write(dev, addr, data, 1); + if (err) + debug("failed to set TPS65219_BUCK1_VOUT_REG (err=%d)\n", err); + } + return 0; } -- cgit v1.2.3