2 * Copyright 2004 Freescale Semiconductor.
4 * Srikanth Srinivasan (srikanth.srinivasan@freescale.com)
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #include <ppc_asm.tmpl>
27 #include <asm/cache.h>
33 * LAW(Local Access Window) configuration:
35 * 0x0000_0000 0x7fff_ffff DDR 2G
36 * 0x8000_0000 0x9fff_ffff PCI1 MEM 512M
37 * 0xa000_0000 0xbfff_ffff PCI2 MEM 512M
38 * 0xc000_0000 0xdfff_ffff RapidIO 512M
39 * 0xe200_0000 0xe2ff_ffff PCI1 IO 16M
40 * 0xe300_0000 0xe3ff_ffff PCI2 IO 16M
41 * 0xf800_0000 0xf80f_ffff CCSRBAR 1M
42 * 0xf810_0000 0xf81f_ffff PIXIS 1M
43 * 0xfe00_0000 0xffff_ffff FLASH (boot bank) 32M
46 * CCSRBAR don't need a configured Local Access Window.
47 * If flash is 8M at default position (last 8M), no LAW needed.
50 #if !defined(CONFIG_SPD_EEPROM)
51 #define LAWBAR1 ((CFG_DDR_SDRAM_BASE>>12) & 0xffffff)
52 #define LAWAR1 (LAWAR_EN | LAWAR_TRGT_IF_DDR1 | (LAWAR_SIZE & LAWAR_SIZE_256M))
55 #define LAWAR1 ((LAWAR_TRGT_IF_DDR1 | (LAWAR_SIZE & LAWAR_SIZE_512M)) & ~LAWAR_EN)
58 #define LAWBAR2 ((CFG_PCI1_MEM_BASE>>12) & 0xffffff)
59 #define LAWAR2 (LAWAR_EN | LAWAR_TRGT_IF_PCI1 | (LAWAR_SIZE & LAWAR_SIZE_512M))
61 #define LAWBAR3 ((CFG_PCI2_MEM_BASE>>12) & 0xffffff)
62 #define LAWAR3 (~LAWAR_EN & (LAWAR_TRGT_IF_PCI2 | (LAWAR_SIZE & LAWAR_SIZE_512M)))
65 * This is not so much the SDRAM map as it is the whole localbus map.
67 #define LAWBAR4 ((0xf8100000>>12) & 0xffffff)
68 #define LAWAR4 (LAWAR_EN | LAWAR_TRGT_IF_LBC | (LAWAR_SIZE & LAWAR_SIZE_2M))
70 #define LAWBAR5 ((CFG_PCI1_IO_BASE>>12) & 0xffffff)
71 #define LAWAR5 (LAWAR_EN | LAWAR_TRGT_IF_PCI1 | (LAWAR_SIZE & LAWAR_SIZE_16M))
73 #define LAWBAR6 ((CFG_PCI2_IO_BASE>>12) & 0xffffff)
74 #define LAWAR6 (~LAWAR_EN &( LAWAR_TRGT_IF_PCI2 | (LAWAR_SIZE & LAWAR_SIZE_16M)))
76 #define LAWBAR7 ((0xfe000000 >>12) & 0xffffff)
77 #define LAWAR7 (LAWAR_EN | LAWAR_TRGT_IF_LBC | (LAWAR_SIZE & LAWAR_SIZE_32M))
79 #if !defined(CONFIG_SPD_EEPROM)
80 #define LAWBAR8 ((CFG_DDR_SDRAM_BASE>>12) & 0xffffff)
81 #define LAWAR8 (LAWAR_EN | LAWAR_TRGT_IF_DDR2 | (LAWAR_SIZE & LAWAR_SIZE_256M))
84 #define LAWAR8 ((LAWAR_TRGT_IF_DDR2 | (LAWAR_SIZE & LAWAR_SIZE_512M)) & ~LAWAR_EN)
87 #define LAWBAR9 ((CFG_RIO_MEM_BASE>>12) & 0xfffff)
88 #define LAWAR9 (LAWAR_EN | LAWAR_TRGT_IF_RIO | (LAWAR_SIZE & LAWAR_SIZE_512M))
90 .section .bootpg, "ax"
94 ori r7,r7,CFG_CCSRBAR@l
99 /* Skip LAWAR0, start at LAWAR1 */
108 /* LAWBAR2, LAWAR2 */
117 /* LAWBAR3, LAWAR3 */
126 /* LAWBAR4, LAWAR4 */
134 /* LAWBAR5, LAWAR5 */
143 /* LAWBAR6, LAWAR6 */
152 /* LAWBAR7, LAWAR7 */
161 /* LAWBAR8, LAWAR8 */
170 /* LAWBAR9, LAWAR9 */