Merge changes Id85b2541,I4d253e2f into integration

* changes:
  fix(intel): update system counter back to 400MHz
  fix(intel): revert back to use L4 clock
This commit is contained in:
Sandrine Bailleux 2024-01-10 13:54:11 +01:00 committed by TrustedFirmware Code Review
commit 9c653440f6
6 changed files with 60 additions and 47 deletions

View file

@ -9,6 +9,7 @@
#define PLAT_SOCFPGA_DEF_H
#include "agilex_system_manager.h"
#include <lib/utils_def.h>
#include <platform_def.h>
/* Platform Setting */
@ -90,8 +91,8 @@
#define PLAT_GICD_BASE (PLAT_GIC_BASE + 0x1000)
#define PLAT_GICR_BASE 0
#define PLAT_SYS_COUNTER_FREQ_IN_TICKS (get_mpu_periph_clk() * PLAT_HZ_CONVERT_TO_MHZ)
#define PLAT_HZ_CONVERT_TO_MHZ (1000000)
#define PLAT_SYS_COUNTER_FREQ_IN_TICKS (400000000)
#define PLAT_HZ_CONVERT_TO_MHZ (1000000)
/*******************************************************************************
* SDMMC related pointer function
@ -106,6 +107,6 @@
#define L2_RESET_DONE_REG 0xFFD12218
/* Platform specific system counter */
#define PLAT_SYS_COUNTER_FREQ_IN_MHZ get_mpu_periph_clk()
#define PLAT_SYS_COUNTER_FREQ_IN_MHZ U(400)
#endif /* PLAT_SOCFPGA_DEF_H */

View file

@ -398,12 +398,21 @@ uint32_t get_mpu_clk(void)
return mpu_clk;
}
uint32_t get_l4_clk(void)
{
uint32_t l4_clk;
l4_clk = get_clk_freq(CLKMGR_MAINPLL_NOCCLK, CLKMGR_MAINPLL_PLLC1,
CLKMGR_PERPLL_PLLC1);
return l4_clk;
}
/* Get cpu freq clock */
uint32_t get_cpu_clk(void)
{
uint32_t cpu_clk;
cpu_clk = get_mpu_clk()/PLAT_HZ_CONVERT_TO_MHZ;
cpu_clk = get_l4_clk()/PLAT_HZ_CONVERT_TO_MHZ;
return cpu_clk;
}

View file

@ -9,14 +9,15 @@
#define PLAT_SOCFPGA_DEF_H
#include <platform_def.h>
#include <lib/utils_def.h>
#include "n5x_system_manager.h"
/* Platform Setting */
#define PLATFORM_MODEL PLAT_SOCFPGA_N5X
#define BOOT_SOURCE BOOT_SOURCE_SDMMC
#define PLAT_PRIMARY_CPU 0
#define PLATFORM_MODEL PLAT_SOCFPGA_N5X
#define BOOT_SOURCE BOOT_SOURCE_SDMMC
#define PLAT_PRIMARY_CPU 0
#define PLAT_CLUSTER_ID_MPIDR_AFF_SHIFT MPIDR_AFF1_SHIFT
#define PLAT_CPU_ID_MPIDR_AFF_SHIFT MPIDR_AFF0_SHIFT
#define PLAT_CPU_ID_MPIDR_AFF_SHIFT MPIDR_AFF0_SHIFT
/* FPGA config helpers */
#define INTEL_SIP_SMC_FPGA_CONFIG_ADDR 0x400000
@ -34,10 +35,10 @@
#define SOCFPGA_SYSMGR_REG_BASE U(0xffd12000)
#define SOCFPGA_ECC_QSPI_REG_BASE U(0xffa22000)
#define SOCFPGA_L4_PER_SCR_REG_BASE U(0xffd21000)
#define SOCFPGA_L4_SYS_SCR_REG_BASE U(0xffd21100)
#define SOCFPGA_SOC2FPGA_SCR_REG_BASE U(0xffd21200)
#define SOCFPGA_LWSOC2FPGA_SCR_REG_BASE U(0xffd21300)
#define SOCFPGA_L4_PER_SCR_REG_BASE U(0xffd21000)
#define SOCFPGA_L4_SYS_SCR_REG_BASE U(0xffd21100)
#define SOCFPGA_SOC2FPGA_SCR_REG_BASE U(0xffd21200)
#define SOCFPGA_LWSOC2FPGA_SCR_REG_BASE U(0xffd21300)
/*******************************************************************************
@ -64,17 +65,17 @@
#define DEVICE4_BASE (0x2000000000)
#define DEVICE4_SIZE (0x0100000000)
#define BL2_BASE (0xffe00000)
#define BL2_LIMIT (0xffe1b000)
#define BL2_BASE (0xffe00000)
#define BL2_LIMIT (0xffe1b000)
#define BL31_BASE (0x1000)
#define BL31_LIMIT (0x81000)
#define BL31_BASE (0x1000)
#define BL31_LIMIT (0x81000)
/*******************************************************************************
* UART related constants
******************************************************************************/
#define PLAT_UART0_BASE (0xFFC02000)
#define PLAT_UART1_BASE (0xFFC02100)
#define PLAT_UART0_BASE (0xFFC02000)
#define PLAT_UART1_BASE (0xFFC02100)
/*******************************************************************************
* WDT related constants
@ -84,19 +85,19 @@
/*******************************************************************************
* GIC related constants
******************************************************************************/
#define PLAT_GIC_BASE (0xFFFC0000)
#define PLAT_GICC_BASE (PLAT_GIC_BASE + 0x2000)
#define PLAT_GICD_BASE (PLAT_GIC_BASE + 0x1000)
#define PLAT_GICR_BASE 0
#define PLAT_GIC_BASE (0xFFFC0000)
#define PLAT_GICC_BASE (PLAT_GIC_BASE + 0x2000)
#define PLAT_GICD_BASE (PLAT_GIC_BASE + 0x1000)
#define PLAT_GICR_BASE 0
#define PLAT_SYS_COUNTER_FREQ_IN_TICKS (get_mpu_periph_clk() * PLAT_HZ_CONVERT_TO_MHZ)
#define PLAT_HZ_CONVERT_TO_MHZ (1000000)
#define PLAT_SYS_COUNTER_FREQ_IN_TICKS (400000000)
#define PLAT_HZ_CONVERT_TO_MHZ (1000000)
/*******************************************************************************
* SDMMC related pointer function
******************************************************************************/
#define SDMMC_READ_BLOCKS mmc_read_blocks
#define SDMMC_WRITE_BLOCKS mmc_write_blocks
#define SDMMC_READ_BLOCKS mmc_read_blocks
#define SDMMC_WRITE_BLOCKS mmc_write_blocks
/*******************************************************************************
* sysmgr.boot_scratch_cold6 & 7 (64bit) are used to indicate L2 reset
@ -105,6 +106,6 @@
#define L2_RESET_DONE_REG 0xFFD12218
/* Platform specific system counter */
#define PLAT_SYS_COUNTER_FREQ_IN_MHZ get_mpu_periph_clk()
#define PLAT_SYS_COUNTER_FREQ_IN_MHZ U(400)
#endif /* PLAT_SOCFPGA_DEF_H */

View file

@ -150,7 +150,7 @@ uint32_t get_cpu_clk(void)
{
uint32_t cpu_clk = 0;
cpu_clk = get_mpu_clk()/PLAT_HZ_CONVERT_TO_MHZ;
cpu_clk = get_l4_clk()/PLAT_HZ_CONVERT_TO_MHZ;
return cpu_clk;
}

View file

@ -95,6 +95,7 @@ uint32_t get_wdt_clk(void);
uint32_t get_uart_clk(void);
uint32_t get_mmc_clk(void);
uint32_t get_l3_clk(uint32_t ref_clk);
uint32_t get_cpu_clk(void);
uint32_t get_ref_clk(uint32_t pllglob);
uint32_t get_mpu_periph_clk(void);

View file

@ -8,14 +8,15 @@
#define PLAT_SOCFPGA_DEF_H
#include <platform_def.h>
#include <lib/utils_def.h>
#include "s10_system_manager.h"
/* Platform Setting */
#define PLATFORM_MODEL PLAT_SOCFPGA_STRATIX10
#define BOOT_SOURCE BOOT_SOURCE_SDMMC
#define PLAT_PRIMARY_CPU 0
#define PLATFORM_MODEL PLAT_SOCFPGA_STRATIX10
#define BOOT_SOURCE BOOT_SOURCE_SDMMC
#define PLAT_PRIMARY_CPU 0
#define PLAT_CLUSTER_ID_MPIDR_AFF_SHIFT MPIDR_AFF1_SHIFT
#define PLAT_CPU_ID_MPIDR_AFF_SHIFT MPIDR_AFF0_SHIFT
#define PLAT_CPU_ID_MPIDR_AFF_SHIFT MPIDR_AFF0_SHIFT
/* FPGA config helpers */
#define INTEL_SIP_SMC_FPGA_CONFIG_ADDR 0x400000
@ -64,17 +65,17 @@
#define DEVICE4_BASE (0x2000000000)
#define DEVICE4_SIZE (0x0100000000)
#define BL2_BASE (0xffe00000)
#define BL2_LIMIT (0xffe2b000)
#define BL2_BASE (0xffe00000)
#define BL2_LIMIT (0xffe2b000)
#define BL31_BASE (0x1000)
#define BL31_LIMIT (0x81000)
#define BL31_BASE (0x1000)
#define BL31_LIMIT (0x81000)
/*******************************************************************************
* UART related constants
******************************************************************************/
#define PLAT_UART0_BASE (0xFFC02000)
#define PLAT_UART1_BASE (0xFFC02100)
#define PLAT_UART0_BASE (0xFFC02000)
#define PLAT_UART1_BASE (0xFFC02100)
/*******************************************************************************
* WDT related constants
@ -84,19 +85,19 @@
/*******************************************************************************
* GIC related constants
******************************************************************************/
#define PLAT_GIC_BASE (0xFFFC0000)
#define PLAT_GICC_BASE (PLAT_GIC_BASE + 0x2000)
#define PLAT_GICD_BASE (PLAT_GIC_BASE + 0x1000)
#define PLAT_GICR_BASE 0
#define PLAT_GIC_BASE (0xFFFC0000)
#define PLAT_GICC_BASE (PLAT_GIC_BASE + 0x2000)
#define PLAT_GICD_BASE (PLAT_GIC_BASE + 0x1000)
#define PLAT_GICR_BASE 0
#define PLAT_SYS_COUNTER_FREQ_IN_TICKS (get_mpu_periph_clk() * PLAT_HZ_CONVERT_TO_MHZ)
#define PLAT_HZ_CONVERT_TO_MHZ (1000000)
#define PLAT_SYS_COUNTER_FREQ_IN_TICKS (400000000)
#define PLAT_HZ_CONVERT_TO_MHZ (1000000)
/*******************************************************************************
* SDMMC related pointer function
******************************************************************************/
#define SDMMC_READ_BLOCKS mmc_read_blocks
#define SDMMC_WRITE_BLOCKS mmc_write_blocks
#define SDMMC_READ_BLOCKS mmc_read_blocks
#define SDMMC_WRITE_BLOCKS mmc_write_blocks
/*******************************************************************************
* sysmgr.boot_scratch_cold6 & 7 (64bit) are used to indicate L2 reset
@ -105,7 +106,7 @@
#define L2_RESET_DONE_REG 0xFFD12218
/* Platform specific system counter */
#define PLAT_SYS_COUNTER_FREQ_IN_MHZ get_mpu_periph_clk()
#define PLAT_SYS_COUNTER_FREQ_IN_MHZ U(400)
#endif /* PLATSOCFPGA_DEF_H */