/* * Copyright (c) 2016-2020, Broadcom * * SPDX-License-Identifier: BSD-3-Clause */ #include #include #include #include #define IHOST0_CONFIG_ROOT 0x66000000 #define IHOST1_CONFIG_ROOT 0x66002000 #define IHOST2_CONFIG_ROOT 0x66004000 #define IHOST3_CONFIG_ROOT 0x66006000 #define A72_CRM_PLL_PWR_ON 0x00000070 #define A72_CRM_PLL_PWR_ON__PLL0_RESETB_R 4 #define A72_CRM_PLL_PWR_ON__PLL0_POST_RESETB_R 5 #define A72_CRM_PLL_CHNL_BYPS_EN 0x000000ac #define A72_CRM_PLL_CHNL_BYPS_EN__PLL_0_CHNL_0_BYPS_EN_R 0 #define A72_CRM_PLL_CHNL_BYPS_EN_DATAMASK 0x0000ec1f #define A72_CRM_PLL_CMD 0x00000080 #define A72_CRM_PLL_CMD__UPDATE_PLL0_FREQUENCY_VCO_R 0 #define A72_CRM_PLL_CMD__UPDATE_PLL0_FREQUENCY_POST_R 1 #define A72_CRM_PLL_STATUS 0x00000084 #define A72_CRM_PLL_STATUS__PLL0_LOCK_R 9 #define A72_CRM_PLL0_CTRL1 0x00000100 #define A72_CRM_PLL0_CTRL2 0x00000104 #define A72_CRM_PLL0_CTRL3 0x00000108 #define A72_CRM_PLL0_CTRL3__PLL0_PDIV_R 12 #define A72_CRM_PLL0_CTRL4 0x0000010c #define A72_CRM_PLL0_CTRL4__PLL0_KP_R 0 #define A72_CRM_PLL0_CTRL4__PLL0_KI_R 4 #define A72_CRM_PLL0_CTRL4__PLL0_KA_R 7 #define A72_CRM_PLL0_CTRL4__PLL0_FREFEFF_INFO_R 10 #define PLL_MODE_VCO 0x0 #define PLL_MODE_BYPASS 0x1 #define PLL_RESET_TYPE_PLL 0x1 #define PLL_RESET_TYPE_POST 0x2 #define PLL_VCO 0x1 #define PLL_POSTDIV 0x2 #define ARM_FREQ_3G PLL_FREQ_FULL #define ARM_FREQ_1P5G PLL_FREQ_HALF #define ARM_FREQ_750M PLL_FREQ_QRTR static unsigned int ARMCOE_crm_getBaseAddress(unsigned int cluster_num) { unsigned int ihostx_config_root; switch (cluster_num) { case 0: default: ihostx_config_root = IHOST0_CONFIG_ROOT; break; case 1: ihostx_config_root = IHOST1_CONFIG_ROOT; break; case 2: ihostx_config_root = IHOST2_CONFIG_ROOT; break; case 3: ihostx_config_root = IHOST3_CONFIG_ROOT; break; } return ihostx_config_root; } static void ARMCOE_crm_pllAssertReset(unsigned int cluster_num, unsigned int reset_type) { unsigned long ihostx_config_root; unsigned int pll_rst_ctrl; ihostx_config_root = ARMCOE_crm_getBaseAddress(cluster_num); pll_rst_ctrl = mmio_read_32(ihostx_config_root + A72_CRM_PLL_PWR_ON); // PLL reset if (reset_type & PLL_RESET_TYPE_PLL) { pll_rst_ctrl &= ~(0x1<