static void imx_cpufreq_set_target(uint32_t cluster_id, unsigned long freq) { sc_pm_clock_rate_t rate = (sc_pm_clock_rate_t)freq; #ifdef PLAT_IMX8QM sc_pm_set_clock_rate(ipc_handle, ap_cluster_index[cluster_id], SC_PM_CLK_CPU, &rate); #endif #ifdef PLAT_IMX8QX sc_pm_set_clock_rate(ipc_handle, SC_R_A35, SC_PM_CLK_CPU, &rate); #endif }
int board_early_init_f(void) { int ret; /* Set UART0 clock root to 80 MHz */ sc_pm_clock_rate_t rate = 80000000; /* Power up UART0 */ ret = sc_pm_set_resource_power_mode(-1, SC_R_UART_0, SC_PM_PW_MODE_ON); if (ret) return ret; ret = sc_pm_set_clock_rate(-1, SC_R_UART_0, 2, &rate); if (ret) return ret; /* Enable UART0 clock root */ ret = sc_pm_clock_enable(-1, SC_R_UART_0, 2, true, false); if (ret) return ret; setup_iomux_uart(); sc_pm_set_resource_power_mode(-1, SC_R_GPIO_5, SC_PM_PW_MODE_ON); return 0; }