Commit 7fbb3dba authored by Madhukar Pappireddy's avatar Madhukar Pappireddy Committed by TrustedFirmware Code Review
Browse files

Merge "mediatek: Add jedec info" into integration

parents f831ed73 74a34600
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
#include <drivers/arm/cci.h> #include <drivers/arm/cci.h>
#include <drivers/console.h> #include <drivers/console.h>
#include <lib/mmio.h> #include <lib/mmio.h>
#include <lib/smccc.h>
#include <lib/xlat_tables/xlat_tables.h> #include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h> #include <plat/common/platform.h>
#include <services/arm_arch_svc.h>
#include <mtk_plat_common.h> #include <mtk_plat_common.h>
#include <mtk_sip_svc.h> #include <mtk_sip_svc.h>
...@@ -116,3 +118,33 @@ uint32_t plat_get_spsr_for_bl33_entry(void) ...@@ -116,3 +118,33 @@ uint32_t plat_get_spsr_for_bl33_entry(void)
spsr = SPSR_MODE32(mode, 0, ee, daif); spsr = SPSR_MODE32(mode, 0, ee, daif);
return spsr; return spsr;
} }
/*****************************************************************************
* plat_is_smccc_feature_available() - This function checks whether SMCCC
* feature is availabile for platform.
* @fid: SMCCC function id
*
* Return SMC_OK if SMCCC feature is available and SMC_ARCH_CALL_NOT_SUPPORTED
* otherwise.
*****************************************************************************/
int32_t plat_is_smccc_feature_available(u_register_t fid)
{
switch (fid) {
case SMCCC_ARCH_SOC_ID:
return SMC_ARCH_CALL_SUCCESS;
default:
return SMC_ARCH_CALL_NOT_SUPPORTED;
}
}
int32_t plat_get_soc_version(void)
{
uint32_t manfid = (JEDEC_MTK_BKID << 24U) | (JEDEC_MTK_MFID << 16U);
return (int32_t)(manfid | (SOC_CHIP_ID & 0xFFFFU));
}
int32_t plat_get_soc_revision(void)
{
return 0;
}
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
#define LINUX_KERNEL_32 0 #define LINUX_KERNEL_32 0
#define SMC32_PARAM_MASK (0xFFFFFFFF) #define SMC32_PARAM_MASK (0xFFFFFFFF)
#define JEDEC_MTK_BKID U(4)
#define JEDEC_MTK_MFID U(0x26)
struct atf_arg_t { struct atf_arg_t {
unsigned int atf_magic; unsigned int atf_magic;
unsigned int tee_support; unsigned int tee_support;
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
PLATFORM_CLUSTER_COUNT + \ PLATFORM_CLUSTER_COUNT + \
PLATFORM_CORE_COUNT) PLATFORM_CORE_COUNT)
#define SOC_CHIP_ID U(0x8173)
/******************************************************************************* /*******************************************************************************
* Platform memory map related constants * Platform memory map related constants
******************************************************************************/ ******************************************************************************/
......
...@@ -279,6 +279,8 @@ INTR_PROP_DESC(MT_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, grp, \ ...@@ -279,6 +279,8 @@ INTR_PROP_DESC(MT_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, grp, \
PLATFORM_CLUSTER_COUNT + \ PLATFORM_CLUSTER_COUNT + \
PLATFORM_CORE_COUNT) PLATFORM_CORE_COUNT)
#define SOC_CHIP_ID U(0x8183)
/******************************************************************************* /*******************************************************************************
* Platform memory map related constants * Platform memory map related constants
******************************************************************************/ ******************************************************************************/
......
...@@ -59,6 +59,8 @@ ...@@ -59,6 +59,8 @@
#define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER0_CORE_COUNT) #define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER0_CORE_COUNT)
#define PLATFORM_MAX_CPUS_PER_CLUSTER U(8) #define PLATFORM_MAX_CPUS_PER_CLUSTER U(8)
#define SOC_CHIP_ID U(0x8192)
/******************************************************************************* /*******************************************************************************
* Platform memory map related constants * Platform memory map related constants
******************************************************************************/ ******************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment