intel: Add bridge control for FPGA reconfig

This is to make sure that bridge access in disabled before doing full
FPGA reconfiguration and turn re-enable it once the configuration
succeed.

Signed-off-by: Hadi Asyrafi <muhammad.hadi.asyrafi.abdul.halim@intel.com>
Change-Id: I1f42fbf04ac1625048bbdf21b8a0443464ed833d
This commit is contained in:
Hadi Asyrafi 2019-12-24 10:42:52 +08:00 committed by Abdul Halim, Muhammad Hadi Asyrafi
parent dfdd38c2e1
commit 9c8f3af50a
3 changed files with 18 additions and 0 deletions

View File

@ -60,6 +60,7 @@ BL31_SOURCES += \
plat/intel/soc/common/socfpga_sip_svc.c \
plat/intel/soc/common/socfpga_topology.c \
plat/intel/soc/common/soc/socfpga_mailbox.c \
plat/intel/soc/common/soc/socfpga_reset_manager.c
PROGRAMMABLE_RESET_ADDRESS := 0
BL2_AT_EL3 := 1

View File

@ -11,6 +11,7 @@
#include <tools_share/uuid.h>
#include "socfpga_mailbox.h"
#include "socfpga_reset_manager.h"
#include "socfpga_sip_svc.h"
/* Number of SiP Calls implemented */
@ -27,6 +28,7 @@ static int rcv_id;
static int max_blocks;
static uint32_t bytes_per_block;
static uint32_t blocks_submitted;
static int is_partial_reconfig;
struct fpga_config_info {
uint32_t addr;
@ -109,6 +111,12 @@ static uint32_t intel_mailbox_fpga_config_isdone(uint32_t query_type)
return INTEL_SIP_SMC_STATUS_ERROR;
}
if (query_type != 1) {
/* full reconfiguration */
if (!is_partial_reconfig)
socfpga_bridges_enable(); /* Enable bridge */
}
return INTEL_SIP_SMC_STATUS_OK;
}
@ -196,6 +204,8 @@ static int intel_fpga_config_start(uint32_t config_type)
uint32_t response[3];
int status = 0;
is_partial_reconfig = config_type;
mailbox_clear_response();
mailbox_send_cmd(1, MBOX_CMD_CANCEL, 0, 0, 0, NULL, 0);
@ -225,6 +235,12 @@ static int intel_fpga_config_start(uint32_t config_type)
send_id = 0;
rcv_id = 0;
/* full reconfiguration */
if (!is_partial_reconfig) {
/* Disable bridge */
socfpga_bridges_disable();
}
return 0;
}

View File

@ -59,6 +59,7 @@ BL31_SOURCES += \
plat/intel/soc/common/socfpga_sip_svc.c \
plat/intel/soc/common/socfpga_topology.c \
plat/intel/soc/common/soc/socfpga_mailbox.c \
plat/intel/soc/common/soc/socfpga_reset_manager.c
PROGRAMMABLE_RESET_ADDRESS := 0
BL2_AT_EL3 := 1