1 // SPDX-License-Identifier: GPL-2.0+
14 #include <asm/global_data.h>
16 #include <asm/arch/imx93_pins.h>
17 #include <asm/arch/clock.h>
18 #include <asm/arch/sys_proto.h>
19 #include <asm/mach-imx/boot_mode.h>
20 #include <asm/mach-imx/mxc_i2c.h>
21 #include <asm/arch-mx7ulp/gpio.h>
22 #include <asm/mach-imx/syscounter.h>
23 #include <dm/uclass.h>
24 #include <dm/device.h>
25 #include <dm/uclass-internal.h>
26 #include <dm/device-internal.h>
27 #include <linux/delay.h>
28 #include <asm/arch/clock.h>
29 #include <asm/arch/ccm_regs.h>
30 #include <asm/arch/ddr.h>
31 #include <power/pmic.h>
32 #include <power/pca9450.h>
33 #include <asm/arch/trdc.h>
35 DECLARE_GLOBAL_DATA_PTR;
37 int spl_board_boot_device(enum boot_device boot_dev_spl)
39 return BOOT_DEVICE_BOOTROM;
42 void spl_board_init(void)
44 puts("Normal Boot\n");
47 void spl_dram_init(void)
49 ddr_init(&dram_timing);
52 #if CONFIG_IS_ENABLED(DM_PMIC_PCA9450)
53 int power_init_board(void)
58 ret = pmic_get("pmic@25", &dev);
60 puts("No pca9450@25\n");
66 /* BUCKxOUT_DVS0/1 control BUCK123 output */
67 pmic_reg_write(dev, PCA9450_BUCK123_DVS, 0x29);
69 /* enable DVS control through PMIC_STBY_REQ */
70 pmic_reg_write(dev, PCA9450_BUCK1CTRL, 0x59);
72 if (IS_ENABLED(CONFIG_IMX9_LOW_DRIVE_MODE)) {
73 /* 0.75v for Low drive mode
75 pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, 0x0c);
76 pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, 0x0c);
78 /* 0.9v for Over drive mode
80 pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, 0x18);
81 pmic_reg_write(dev, PCA9450_BUCK3OUT_DVS0, 0x18);
84 /* set standby voltage to 0.65v */
85 pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS1, 0x4);
88 pmic_reg_write(dev, 0xa, 0x3);
93 extern int imx9_probe_mu(void *ctx, struct event *event);
94 void board_init_f(ulong dummy)
99 memset(__bss_start, 0, __bss_end - __bss_start);
105 board_early_init_f();
109 preloader_console_init();
111 ret = imx9_probe_mu(NULL, NULL);
113 printf("Fail to init Sentinel API\n");
115 printf("SOC: 0x%x\n", gd->arch.soc_rev);
116 printf("LC: 0x%x\n", gd->arch.lifecycle);
121 if (!IS_ENABLED(CONFIG_IMX9_LOW_DRIVE_MODE))
122 set_arm_clk(get_cpu_speed_grade_hz());
124 /* Init power of mix */
127 /* Setup TRDC for DDR access */
130 /* DDR initialization */
133 /* Put M33 into CPUWAIT for following kick */
136 printf("M33 prepare ok\n");
138 board_init_r(NULL, 0);