Skip to content

Commit

Permalink
plat-imx: mx6: support for TZASC on 6UL/ULL
Browse files Browse the repository at this point in the history
The i.MX6UL/ULL processors support only one instance of the TZC380 IP.
Use only one to setup the firewall mappings.

Signed-off-by: Rouven Czerwinski <[email protected]>
Reviewed-by: Peng Fan <[email protected]>
Acked-by: Etienne Carriere <[email protected]>
  • Loading branch information
Emantor authored and jforissier committed Nov 21, 2019
1 parent 5966660 commit 549c2eb
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions core/arch/arm/plat-imx/drivers/tzc380.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,39 @@
* Rouven Czerwinski <[email protected]>
*/

#include <config.h>
#include <drivers/tzc380.h>
#include <imx-regs.h>
#include <imx.h>
#include <mm/core_memprot.h>
#include <mm/generic_ram_layout.h>

/*
* TZASC2_BASE is asserted non null when used.
* This is needed to compile the code for i.MX6UL/L
* and i.MX8MQ.
*/
#ifndef TZASC2_BASE
#define TZASC2_BASE 0
#endif

void imx_configure_tzasc(void)
{

int i;
int i = 0;
int end = 1;
vaddr_t addr[2] = {0};

addr[0] = core_mmu_get_va(TZASC_BASE, MEM_AREA_IO_SEC);
addr[1] = core_mmu_get_va(TZASC2_BASE, MEM_AREA_IO_SEC);

for (i = 0; i < 2; i++) {
if (IS_ENABLED(CFG_MX6Q) || IS_ENABLED(CFG_MX6D) ||
IS_ENABLED(CFG_MX6DL)) {
assert(TZASC2_BASE != 0);
addr[1] = core_mmu_get_va(TZASC2_BASE, MEM_AREA_IO_SEC);
end = 2;
}

for (i = 0; i < end; i++) {
uint8_t region = 1;

tzc_init(addr[i]);
Expand Down

0 comments on commit 549c2eb

Please sign in to comment.