mediatek: Add jedec info

Add jedec info for mt8173, mt8183, and mt8192.

[1] http://www.softnology.biz/pdf/JEP106AV.pdf

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Change-Id: Iab36fd580131f0b09b27223fba0e9d1e187d9196
This commit is contained in:
Hsin-Yi Wang 2020-08-27 13:48:48 +08:00
parent d35403feab
commit 74a3460039
5 changed files with 41 additions and 0 deletions

View File

@ -10,8 +10,10 @@
#include <drivers/arm/cci.h>
#include <drivers/console.h>
#include <lib/mmio.h>
#include <lib/smccc.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include <services/arm_arch_svc.h>
#include <mtk_plat_common.h>
#include <mtk_sip_svc.h>
@ -116,3 +118,33 @@ uint32_t plat_get_spsr_for_bl33_entry(void)
spsr = SPSR_MODE32(mode, 0, ee, daif);
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;
}

View File

@ -18,6 +18,9 @@
#define LINUX_KERNEL_32 0
#define SMC32_PARAM_MASK (0xFFFFFFFF)
#define JEDEC_MTK_BKID U(4)
#define JEDEC_MTK_MFID U(0x26)
struct atf_arg_t {
unsigned int atf_magic;
unsigned int tee_support;

View File

@ -51,6 +51,8 @@
PLATFORM_CLUSTER_COUNT + \
PLATFORM_CORE_COUNT)
#define SOC_CHIP_ID U(0x8173)
/*******************************************************************************
* Platform memory map related constants
******************************************************************************/

View File

@ -279,6 +279,8 @@ INTR_PROP_DESC(MT_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, grp, \
PLATFORM_CLUSTER_COUNT + \
PLATFORM_CORE_COUNT)
#define SOC_CHIP_ID U(0x8183)
/*******************************************************************************
* Platform memory map related constants
******************************************************************************/

View File

@ -59,6 +59,8 @@
#define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER0_CORE_COUNT)
#define PLATFORM_MAX_CPUS_PER_CLUSTER U(8)
#define SOC_CHIP_ID U(0x8192)
/*******************************************************************************
* Platform memory map related constants
******************************************************************************/