// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2021 NXP */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DECLARE_GLOBAL_DATA_PTR; void spl_dram_init(void) { init_clk_ddr(); ddr_init(&dram_timing); } u32 spl_boot_device(void) { return BOOT_DEVICE_BOOTROM; } int power_init_board(void) { /* Set buck3 to 1.1v OD */ upower_pmic_i2c_write(0x22, 0x28); return 0; } void spl_board_init(void) { struct udevice *dev; uclass_find_first_device(UCLASS_MISC, &dev); for (; dev; uclass_find_next_device(&dev)) { if (device_probe(dev)) continue; } board_early_init_f(); preloader_console_init(); puts("Normal Boot\n"); /* After AP set iomuxc0, the i2c can't work, Need M33 to set it now */ /* Load the lposc fuse for single boot to work around ROM issue, * The fuse depends on S400 to read. */ if (is_soc_rev(CHIP_REV_1_0) && get_boot_mode() == SINGLE_BOOT) load_lposc_fuse(); upower_init(); power_init_board(); /* DDR initialization */ spl_dram_init(); /* This must place after upower init, so access to MDA and MRC are valid */ /* Init XRDC MDA */ xrdc_init_mda(); /* Init XRDC MRC for VIDEO, DSP domains */ xrdc_init_mrc(); /* Call it after PS16 power up */ set_lpav_qos(); } void board_init_f(ulong dummy) { /* Clear the BSS. */ memset(__bss_start, 0, __bss_end - __bss_start); timer_init(); arch_cpu_init(); board_init_r(NULL, 0); }