1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2012-2016 Freescale Semiconductor, Inc.
7 #include <asm/fsl_pamu.h>
9 DECLARE_GLOBAL_DATA_PTR
;
11 void construct_pamu_addr_table(struct pamu_addr_tbl
*tbl
, int *num_entries
)
17 (uint64_t)virt_to_phys((void *)CONFIG_SYS_SDRAM_BASE
);
18 tbl
->size
[i
] = (phys_size_t
)(min(gd
->ram_size
, CONFIG_MAX_MEM_MAPPED
));
19 tbl
->end_addr
[i
] = tbl
->start_addr
[i
] + tbl
->size
[i
] - 1;
22 #ifdef CONFIG_SYS_FLASH_BASE_PHYS
24 (uint64_t)virt_to_phys((void *)CONFIG_SYS_FLASH_BASE_PHYS
);
25 tbl
->size
[i
] = 256 * 1024 * 1024; /* 256MB flash */
26 tbl
->end_addr
[i
] = tbl
->start_addr
[i
] + tbl
->size
[i
] - 1;
30 #if (defined(CONFIG_SPL_BUILD) && (CONFIG_SYS_INIT_L3_VADDR))
32 (uint64_t)virt_to_phys((void *)CONFIG_SYS_INIT_L3_VADDR
);
33 tbl
->size
[i
] = 256 * 1024; /* 256K CPC flash */
34 tbl
->end_addr
[i
] = tbl
->start_addr
[i
] + tbl
->size
[i
] - 1;
38 debug("PAMU address\t\t\tsize\n");
39 for (j
= 0; j
< i
; j
++)
40 debug("%llx \t\t\t%llx\n", tbl
->start_addr
[j
], tbl
->size
[j
]);
45 int sec_config_pamu_table(uint32_t liodn_ns
, uint32_t liodn_s
)
47 struct pamu_addr_tbl tbl
;
51 construct_pamu_addr_table(&tbl
, &num_entries
);
53 ret
= config_pamu(&tbl
, num_entries
, liodn_ns
);
57 ret
= config_pamu(&tbl
, num_entries
, liodn_s
);