From b7f3044e8725d9af997999547630892cf9e2f0ad Mon Sep 17 00:00:00 2001 From: "Abdul Halim, Muhammad Hadi Asyrafi" Date: Thu, 18 Jun 2020 16:21:29 +0800 Subject: [PATCH] feat(intel): enable SMC SoC FPGA bridges enable/disable Enable SoC FPGA bridges enable/disable from non-secure world through secure monitor calls Signed-off-by: Abdul Halim, Muhammad Hadi Asyrafi Change-Id: I4474abab9731923a61ff0e7eb2c2fa32048001cb Signed-off-by: Jit Loon Lim --- plat/intel/soc/common/include/socfpga_sip_svc.h | 1 + plat/intel/soc/common/socfpga_sip_svc.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/plat/intel/soc/common/include/socfpga_sip_svc.h b/plat/intel/soc/common/include/socfpga_sip_svc.h index 9ca2bae31..63b28fb98 100644 --- a/plat/intel/soc/common/include/socfpga_sip_svc.h +++ b/plat/intel/soc/common/include/socfpga_sip_svc.h @@ -49,6 +49,7 @@ /* Send Mailbox Command */ #define INTEL_SIP_SMC_MBOX_SEND_CMD 0xC200001E +#define INTEL_SIP_SMC_HPS_SET_BRIDGES 0xC2000032 /* SiP Definitions */ diff --git a/plat/intel/soc/common/socfpga_sip_svc.c b/plat/intel/soc/common/socfpga_sip_svc.c index dc3a94b63..13ef80984 100644 --- a/plat/intel/soc/common/socfpga_sip_svc.c +++ b/plat/intel/soc/common/socfpga_sip_svc.c @@ -440,6 +440,18 @@ static uint32_t intel_mbox_send_cmd(uint32_t cmd, uint32_t *args, return INTEL_SIP_SMC_STATUS_OK; } +/* Miscellaneous HPS services */ +static uint32_t intel_hps_set_bridges(uint64_t enable) +{ + if (enable != 0U) { + socfpga_bridges_enable(); + } else { + socfpga_bridges_disable(); + } + + return INTEL_SIP_SMC_STATUS_OK; +} + /* * This function is responsible for handling all SiP calls from the NS world */ @@ -583,6 +595,10 @@ uintptr_t sip_smc_handler(uint32_t smc_fid, SIP_SVC_VERSION_MAJOR, SIP_SVC_VERSION_MINOR); + case INTEL_SIP_SMC_HPS_SET_BRIDGES: + status = intel_hps_set_bridges(x1); + SMC_RET1(handle, status); + default: return socfpga_sip_handler(smc_fid, x1, x2, x3, x4, cookie, handle, flags);