xref: /openbmc/u-boot/board/freescale/t4qds/law.c (revision 49e946cb6ae0448492147ffcb9dcd7d0af1eab4d)
1ee52b188SYork Sun /*
2ee52b188SYork Sun  * Copyright 2008-2012 Freescale Semiconductor, Inc.
3ee52b188SYork Sun  *
4ee52b188SYork Sun  * (C) Copyright 2000
5ee52b188SYork Sun  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6ee52b188SYork Sun  *
7ee52b188SYork Sun  * See file CREDITS for list of people who contributed to this
8ee52b188SYork Sun  * project.
9ee52b188SYork Sun  *
10ee52b188SYork Sun  * This program is free software; you can redistribute it and/or
11ee52b188SYork Sun  * modify it under the terms of the GNU General Public License as
12ee52b188SYork Sun  * published by the Free Software Foundation; either version 2 of
13ee52b188SYork Sun  * the License, or (at your option) any later version.
14ee52b188SYork Sun  *
15ee52b188SYork Sun  * This program is distributed in the hope that it will be useful,
16ee52b188SYork Sun  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17ee52b188SYork Sun  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18ee52b188SYork Sun  * GNU General Public License for more details.
19ee52b188SYork Sun  *
20ee52b188SYork Sun  * You should have received a copy of the GNU General Public License
21ee52b188SYork Sun  * along with this program; if not, write to the Free Software
22ee52b188SYork Sun  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23ee52b188SYork Sun  * MA 02111-1307 USA
24ee52b188SYork Sun  */
25ee52b188SYork Sun 
26ee52b188SYork Sun #include <common.h>
27ee52b188SYork Sun #include <asm/fsl_law.h>
28ee52b188SYork Sun #include <asm/mmu.h>
29ee52b188SYork Sun 
30ee52b188SYork Sun struct law_entry law_table[] = {
31ee52b188SYork Sun 	SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_IFC),
32ee52b188SYork Sun #ifdef CONFIG_SYS_BMAN_MEM_PHYS
33ee52b188SYork Sun 	SET_LAW(CONFIG_SYS_BMAN_MEM_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_BMAN),
34ee52b188SYork Sun #endif
35ee52b188SYork Sun #ifdef CONFIG_SYS_QMAN_MEM_PHYS
36ee52b188SYork Sun 	SET_LAW(CONFIG_SYS_QMAN_MEM_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_QMAN),
37ee52b188SYork Sun #endif
38ee52b188SYork Sun 	SET_LAW(QIXIS_BASE_PHYS, LAW_SIZE_4K, LAW_TRGT_IF_IFC),
39ee52b188SYork Sun #ifdef CONFIG_SYS_DCSRBAR_PHYS
40*49e946cbSStephen George 	/* Limit DCSR to 32M to access NPC Trace Buffer */
41*49e946cbSStephen George 	SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_DCSR),
42ee52b188SYork Sun #endif
43ee52b188SYork Sun #ifdef CONFIG_SYS_NAND_BASE_PHYS
44ac13eb5dSPrabhakar Kushwaha 	SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_IFC),
45ee52b188SYork Sun #endif
46ee52b188SYork Sun };
47ee52b188SYork Sun 
48ee52b188SYork Sun int num_law_entries = ARRAY_SIZE(law_table);
49