mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-24 22:05:40 +00:00
Merge "feat(allwinner): add SMCCC SOCID support" into integration
This commit is contained in:
commit
8ac22f79c4
2 changed files with 31 additions and 0 deletions
|
@ -20,4 +20,7 @@
|
|||
#define SUNXI_SOC_H616 0x1823
|
||||
#define SUNXI_SOC_R329 0x1851
|
||||
|
||||
#define JEDEC_ALLWINNER_BKID 9U
|
||||
#define JEDEC_ALLWINNER_MFID 0x9eU
|
||||
|
||||
#endif /* SUNXI_DEF_H */
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
|
||||
#include <common/debug.h>
|
||||
#include <lib/mmio.h>
|
||||
#include <lib/smccc.h>
|
||||
#include <lib/xlat_tables/xlat_tables_v2.h>
|
||||
#include <services/arm_arch_svc.h>
|
||||
|
||||
#include <sunxi_def.h>
|
||||
#include <sunxi_mmap.h>
|
||||
|
@ -157,3 +159,29 @@ int sunxi_init_platform_r_twi(uint16_t socid, bool use_rsb)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = SOC_ID_SET_JEP_106(JEDEC_ALLWINNER_BKID, JEDEC_ALLWINNER_MFID);
|
||||
|
||||
return ret | (sunxi_read_soc_id() & SOC_ID_IMPL_DEF_MASK);
|
||||
}
|
||||
|
||||
int32_t plat_get_soc_revision(void)
|
||||
{
|
||||
uint32_t reg = mmio_read_32(SRAM_VER_REG);
|
||||
|
||||
return reg & GENMASK_32(7, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue