xref: /openbmc/u-boot/board/xes/xpedite550x/law.c (revision bfe18815)
1*bfe18815SJohn Schmoller /*
2*bfe18815SJohn Schmoller  * Copyright 2010 Extreme Engineering Solutions, Inc.
3*bfe18815SJohn Schmoller  * Copyright 2008 Freescale Semiconductor, Inc.
4*bfe18815SJohn Schmoller  *
5*bfe18815SJohn Schmoller  * (C) Copyright 2000
6*bfe18815SJohn Schmoller  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7*bfe18815SJohn Schmoller  *
8*bfe18815SJohn Schmoller  * See file CREDITS for list of people who contributed to this
9*bfe18815SJohn Schmoller  * project.
10*bfe18815SJohn Schmoller  *
11*bfe18815SJohn Schmoller  * This program is free software; you can redistribute it and/or
12*bfe18815SJohn Schmoller  * modify it under the terms of the GNU General Public License as
13*bfe18815SJohn Schmoller  * published by the Free Software Foundation; either version 2 of
14*bfe18815SJohn Schmoller  * the License, or (at your option) any later version.
15*bfe18815SJohn Schmoller  *
16*bfe18815SJohn Schmoller  * This program is distributed in the hope that it will be useful,
17*bfe18815SJohn Schmoller  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18*bfe18815SJohn Schmoller  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19*bfe18815SJohn Schmoller  * GNU General Public License for more details.
20*bfe18815SJohn Schmoller  *
21*bfe18815SJohn Schmoller  * You should have received a copy of the GNU General Public License
22*bfe18815SJohn Schmoller  * along with this program; if not, write to the Free Software
23*bfe18815SJohn Schmoller  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24*bfe18815SJohn Schmoller  * MA 02111-1307 USA
25*bfe18815SJohn Schmoller  */
26*bfe18815SJohn Schmoller 
27*bfe18815SJohn Schmoller #include <common.h>
28*bfe18815SJohn Schmoller #include <asm/fsl_law.h>
29*bfe18815SJohn Schmoller #include <asm/mmu.h>
30*bfe18815SJohn Schmoller 
31*bfe18815SJohn Schmoller /*
32*bfe18815SJohn Schmoller  * Notes:
33*bfe18815SJohn Schmoller  *    CCSRBAR and L2-as-SRAM don't need a configured Local Access Window.
34*bfe18815SJohn Schmoller  *    If flash is 8M at default position (last 8M), no LAW needed.
35*bfe18815SJohn Schmoller  */
36*bfe18815SJohn Schmoller 
37*bfe18815SJohn Schmoller struct law_entry law_table[] = {
38*bfe18815SJohn Schmoller 	SET_LAW(CONFIG_SYS_FLASH_BASE2, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
39*bfe18815SJohn Schmoller 	SET_LAW(CONFIG_SYS_NAND_BASE, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
40*bfe18815SJohn Schmoller #ifdef CONFIG_SYS_PCIE1_MEM_PHYS
41*bfe18815SJohn Schmoller 	SET_LAW(CONFIG_SYS_PCIE1_MEM_PHYS, LAW_SIZE_1G, LAW_TRGT_IF_PCIE_1),
42*bfe18815SJohn Schmoller 	SET_LAW(CONFIG_SYS_PCIE1_IO_PHYS, LAW_SIZE_8M, LAW_TRGT_IF_PCIE_1),
43*bfe18815SJohn Schmoller #endif
44*bfe18815SJohn Schmoller #ifdef CONFIG_SYS_PCIE2_MEM_PHYS
45*bfe18815SJohn Schmoller 	SET_LAW(CONFIG_SYS_PCIE2_MEM_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_PCIE_2),
46*bfe18815SJohn Schmoller 	SET_LAW(CONFIG_SYS_PCIE2_IO_PHYS, LAW_SIZE_8M, LAW_TRGT_IF_PCIE_2),
47*bfe18815SJohn Schmoller #endif
48*bfe18815SJohn Schmoller #ifdef CONFIG_SYS_PCIE3_MEM_PHYS
49*bfe18815SJohn Schmoller 	SET_LAW(CONFIG_SYS_PCIE3_MEM_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_PCIE_3),
50*bfe18815SJohn Schmoller 	SET_LAW(CONFIG_SYS_PCIE3_IO_PHYS, LAW_SIZE_8M, LAW_TRGT_IF_PCIE_3),
51*bfe18815SJohn Schmoller #endif
52*bfe18815SJohn Schmoller };
53*bfe18815SJohn Schmoller 
54*bfe18815SJohn Schmoller int num_law_entries = ARRAY_SIZE(law_table);
55