SPRACX6 June 2021 DRA821U , DRA821U , DRA821U-Q1 , DRA821U-Q1 , DRA829J , DRA829J , DRA829J-Q1 , DRA829J-Q1 , DRA829V , DRA829V , DRA829V-Q1 , DRA829V-Q1 , TDA4VM , TDA4VM , TDA4VM-Q1 , TDA4VM-Q1
For each entry in the table of firewall regions
The ownership in this case is set to the MCU Boot Island where the SBL code will be running.
uint32_t i = 0;
uint32_t j = 0;
uint32_t j721e_fwl_count = 3; // Number of entries
struct tisci_msg_fwl_set_firewall_region_resp respFwCtrl = {0};
struct tisci_msg_fwl_set_firewall_region_req reqFwCtrl;
for (i = 0; i < j721e_fwl_count; i++)
{
/* Setting Owner */
struct tisci_msg_fwl_change_owner_info_req req;
req.fwl_id = (uint16_t)j721e_fwl_data[i].fwl_id;
req.region = (uint16_t) j721e_fwl_data[i].region;
req.owner_index = (uint8_t) HOST_ID_MCU_0_R5_1; // Cortex R5 context 1 on MCU island(Boot)
struct tisci_msg_fwl_change_owner_info_resp resp = {0};
status = Sciclient_firewallChangeOwnerInfo(&req, &resp, SCICLIENT_SERVICE_WAIT_FOREVER);
if (status != CSL_PASS)
{
SBL_log(SBL_LOG_ERR,"Firewall Unable to change Owner, %d\n", i);
J721E_dump_owner_req(&req);
}
/* Setting Region */
reqFwCtrl.fwl_id = (uint16_t) j721e_fwl_data[i].fwl_id;
reqFwCtrl.region = (uint16_t) j721e_fwl_data[i].region;
reqFwCtrl.n_permission_regs = (uint32_t) j721e_fwl_data[i].n_permission_regs;
reqFwCtrl.control = (uint32_t) j721e_fwl_data[i].control;
for(j = 0; j < reqFwCtrl.n_permission_regs; j++)
{
reqFwCtrl.permissions[j] = (uint32_t) j721e_fwl_data[i].permissions[j];
}
reqFwCtrl.start_address = j721e_fwl_data[i].start_address;
reqFwCtrl.end_address = j721e_fwl_data[i].end_address;
status = Sciclient_firewallSetRegion(&reqFwCtrl, &respFwCtrl, SCICLIENT_SERVICE_WAIT_FOREVER);
if (status != CSL_PASS)
{
SBL_log(SBL_LOG_ERR,"Firewall entry/%d, region set failed.\n", i);
J721E_dump_region_req(&reqFwCtrl);
}
}