Skip to content

Commit ed0d7e7

Browse files
committed
Portenta-X8 spl/u-boot: rebase changes to support Portenta-X8 hw [2]
1 parent 4589cc9 commit ed0d7e7

File tree

1 file changed

+21
-8
lines changed
  • meta-arduino-bsp/recipes-bsp/u-boot/u-boot-imx/portenta-x8

1 file changed

+21
-8
lines changed

meta-arduino-bsp/recipes-bsp/u-boot/u-boot-imx/portenta-x8/spl.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ void spl_dram_init(void)
6464
#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
6565
struct i2c_pads_info i2c_pad_info1 = {
6666
.scl = {
67-
.i2c_mode = IMX8MM_PAD_I2C1_SCL_I2C1_SCL | PC,
68-
.gpio_mode = IMX8MM_PAD_I2C1_SCL_GPIO5_IO14 | PC,
69-
.gp = IMX_GPIO_NR(5, 14),
67+
.i2c_mode = IMX8MM_PAD_I2C2_SCL_I2C2_SCL | PC | ((iomux_v3_cfg_t)(IOMUX_CONFIG_SION) << MUX_MODE_SHIFT),
68+
.gpio_mode = IMX8MM_PAD_I2C2_SCL_GPIO5_IO16 | PC,
69+
.gp = IMX_GPIO_NR(5, 16),
7070
},
7171
.sda = {
72-
.i2c_mode = IMX8MM_PAD_I2C1_SDA_I2C1_SDA | PC,
73-
.gpio_mode = IMX8MM_PAD_I2C1_SDA_GPIO5_IO15 | PC,
74-
.gp = IMX_GPIO_NR(5, 15),
72+
.i2c_mode = IMX8MM_PAD_I2C2_SDA_I2C2_SDA | PC | ((iomux_v3_cfg_t)(IOMUX_CONFIG_SION) << MUX_MODE_SHIFT),
73+
.gpio_mode = IMX8MM_PAD_I2C2_SDA_GPIO5_IO17 | PC,
74+
.gp = IMX_GPIO_NR(5, 17),
7575
},
7676
};
7777

@@ -191,7 +191,7 @@ int board_mmc_getcd(struct mmc *mmc)
191191
}
192192

193193
#if CONFIG_IS_ENABLED(POWER_LEGACY)
194-
#define I2C_PMIC 0
194+
#define I2C_PMIC 1
195195
#ifdef CONFIG_POWER_PCA9450
196196
int power_init_board(void)
197197
{
@@ -258,6 +258,9 @@ int power_init_board(void)
258258
pmic_reg_write(p, BD718XX_4TH_NODVS_BUCK_VOLT, 0x28);
259259
#endif
260260

261+
/* enable LDO5 and set to 3.0V for ANX7625 */
262+
pmic_reg_write(p, BD718XX_LDO5_VOLT, 0xcc);
263+
261264
/* lock the PMIC regs */
262265
pmic_reg_write(p, BD718XX_REGLOCK, 0x11);
263266

@@ -285,6 +288,8 @@ int board_fit_config_name_match(const char *name)
285288
}
286289
#endif
287290

291+
#define ANX7625_VBUS_CTL_PAD IMX_GPIO_NR(4, 13)
292+
288293
void board_init_f(ulong dummy)
289294
{
290295
int ret;
@@ -300,6 +305,10 @@ void board_init_f(ulong dummy)
300305

301306
preloader_console_init();
302307

308+
printf("Turn Off VBUS\n");
309+
gpio_request(ANX7625_VBUS_CTL_PAD, "anx_vbus_ctl"); /* 0 = VBUS On, 1 = VBUS Off */
310+
gpio_direction_output(ANX7625_VBUS_CTL_PAD, 1);
311+
303312
ret = spl_init();
304313
if (ret) {
305314
debug("spl_init() failed: %d\n", ret);
@@ -309,10 +318,14 @@ void board_init_f(ulong dummy)
309318
enable_tzc380();
310319

311320
/* Adjust pmic voltage to 1.0V for 800M */
312-
setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
321+
setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
313322

314323
power_init_board();
315324

325+
printf("Turn on SE050\n");
326+
gpio_request(IMX_GPIO_NR(1, 3), "CRYPTO_EN");
327+
gpio_direction_output(IMX_GPIO_NR(1, 3), 1);
328+
316329
/* DDR initialization */
317330
spl_dram_init();
318331

0 commit comments

Comments
 (0)