xref: /openbmc/u-boot/board/freescale/t4qds/law.c (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
2ee52b188SYork Sun /*
3ee52b188SYork Sun  * Copyright 2008-2012 Freescale Semiconductor, Inc.
4ee52b188SYork Sun  *
5ee52b188SYork Sun  * (C) Copyright 2000
6ee52b188SYork Sun  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7ee52b188SYork Sun  */
8ee52b188SYork Sun 
9ee52b188SYork Sun #include <common.h>
10ee52b188SYork Sun #include <asm/fsl_law.h>
11ee52b188SYork Sun #include <asm/mmu.h>
12ee52b188SYork Sun 
13ee52b188SYork Sun struct law_entry law_table[] = {
14ee52b188SYork Sun 	SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_IFC),
15ee52b188SYork Sun #ifdef CONFIG_SYS_BMAN_MEM_PHYS
16ee52b188SYork Sun 	SET_LAW(CONFIG_SYS_BMAN_MEM_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_BMAN),
17ee52b188SYork Sun #endif
18ee52b188SYork Sun #ifdef CONFIG_SYS_QMAN_MEM_PHYS
19ee52b188SYork Sun 	SET_LAW(CONFIG_SYS_QMAN_MEM_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_QMAN),
20ee52b188SYork Sun #endif
211cb19fbbSYork Sun #ifdef QIXIS_BASE_PHYS
22ee52b188SYork Sun 	SET_LAW(QIXIS_BASE_PHYS, LAW_SIZE_4K, LAW_TRGT_IF_IFC),
231cb19fbbSYork Sun #endif
24ee52b188SYork Sun #ifdef CONFIG_SYS_DCSRBAR_PHYS
2549e946cbSStephen George 	/* Limit DCSR to 32M to access NPC Trace Buffer */
2649e946cbSStephen George 	SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_DCSR),
27ee52b188SYork Sun #endif
28ee52b188SYork Sun #ifdef CONFIG_SYS_NAND_BASE_PHYS
29ac13eb5dSPrabhakar Kushwaha 	SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_IFC),
30ee52b188SYork Sun #endif
31ee52b188SYork Sun };
32ee52b188SYork Sun 
33ee52b188SYork Sun int num_law_entries = ARRAY_SIZE(law_table);
34