SPRACX6 June   2021 DRA821U , DRA821U , DRA829J , DRA829J , DRA829V , DRA829V , TDA4VM , TDA4VM , TDA4VM-Q1 , TDA4VM-Q1

 

  1.   Trademarks
  2. 1Introduction
  3. 2Firewall Documentation
    1. 2.1 Technical Reference Manual (TRM)
    2. 2.2 SDK TISCI Documentation
    3. 2.3 SDK Firewall Documentation
    4. 2.4 TI NDA Firewall Slide Sets
  4. 3Firewall Definitions and Terms
  5. 4SysConfig Tool
  6. 5Master Firewall versus Slave Firewall
    1. 5.1 Slave Firewalls
    2. 5.2 Master Firewalls
    3. 5.3 A72 Master Firewall
  7. 6Where to Firewall
    1. 6.1 Example
  8. 7Programming Firewalls
    1. 7.1 Sample SBL Code
      1. 7.1.1 Create a Table
      2. 7.1.2 Parse the Table of Firewall Regions
      3. 7.1.3 Utility Functions
      4. 7.1.4 Processor SDK 7.1 SBL Example

Parse the Table of Firewall Regions

For each entry in the table of firewall regions

  1. set the ownership, using the defined TISCI APIs
  2. program the region, using the defined TISCI APIs

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);
		}
	}